Q19.Given the following hierarchical relationship of several classes.. Z- K" N7 b W# r0 G
1. Object" h& o! ~ G2 c/ A+ q" d
2. |---TypeA6 B q3 D1 j6 c! b! o
3. | |-----TypeAB
' f; A! b! N! b 4. | |-----TypeAC
" j7 p( M1 X% W4 q# U 5. |--------TypeY And given the following method definition9 i( N; {) C; l6 A2 ]
6. public sayType(Object x ){ O M* X4 r5 P2 E% s) [+ Y
7. if(x instanceof Object )System.out.print(“Object,”);
& W1 P' b s4 |% r7 @ 8. if(x instanceof TypeA )System.out.print(“TypeA,”); D/ r; ], i5 C
9. if(x instanceof TypeAB )System.out.print(“TypeAB,”);9 D. E+ A3 J k, G ?' _2 }
10. if(x instanceof TypeAC )System.out.print(“TypeAC,”);$ ?! l, z) ? G9 q) g5 {) s
11. }What would the program output be if the following line was executed
9 V2 \0 e% u( `8 j$ Y 12. sayType( new TypeAB() );
4 o7 q9 ~& h0 O- X9 K7 |; | a. Object,- A0 P; n! }; X2 G9 r
b. Object,TypeA,TypeAB,( @% D$ N: N) {4 W
c. TypeAB,
# p9 H& _. k+ U* V& [ d. Object,TypeAC,
) k. x% ]% T2 _1 C2 [ Q20.What happens on trying to compile and run the following code?
& a; x- U4 K1 {& h9 A 1. public class EqualsTest{
% N- p+ ?% g2 b% T, q 2. public static void main(String args[]){9 B: N2 b" M3 Z1 e+ m) j
3. Long LA = new Long( 9 ) ;8 r& ~6 q" K+ `% n( N& N8 D. q# Y
3 r$ |; j/ J* ~
4. Long LB = new Long( 9 ) ; |