Multiple choice technology programming languages

class test{} class tester extends test{ public static void main(String[] args) { test t1 = new tester(); test t2 = new test(); tester t3 = new tester(); System.out.println( t1 instanceof tester); System.out.println( t2 instanceof tester); System.out.println( t3 instanceof tester); System.out.println( t1 instanceof test); System.out.println( t2 instanceof test); System.out.println( t3 instanceof test); }

  1. True False True True True True

  2. True False False True True True

  3. True False True True True False

  4. True False True True False True

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

t1 and t3 are instances of tester, so instanceof tester is true for both, but false for t2 (which is a test). Since tester inherits from test, all three objects (t1, t2, and t3) are instances of test, making instanceof test true for all of them.