Q100 What is the value of 8|9&10^11?& y8 s& R; ]! Z( N7 F% U w/ [+ ]
A 8
/ Q' E) B! o8 M1 J: S# \ B 9
" g( T, c+ F3 L/ H C 10) }2 h0 y* a* i
D 11
, e, h9 t" \! w Q101 What is the output of the following program?$ ?7 ^/ e3 w+ q- n' z/ V4 e8 V
class S1 {' {+ y- W% Q3 v( |6 e
public static void main(String [] args)
4 q, g4 N& w* H {8 M2 L7 l4 Y D
new S2();
% N: b: }) Y, f+ y3 Q8 } }
9 N/ E& s' h( @+ _: m, o+ x S1() {$ ^, l9 O! Y4 q1 ]! E: t0 a
System.out.print(“S1”);7 y6 g' H$ Y1 O# x+ }" o
}
4 y" g( V: b6 Z9 A }- S/ Z( S* T2 @: F7 c+ o
class S2 extends S1 {1 V" t! {2 ]) O* G
S2() {
9 l$ D9 y! }# E: D7 D' K6 f% S8 B9 j System.out.print(“S2”);0 J' q- X9 x7 y- x4 d2 Q" }8 j
}
+ C9 O/ l9 K, n }
3 t* Z9 T. o6 M' v" @# C/ x# N. S5 I A S1
: h2 R! ]+ R0 w: q6 Z B S2- I- V v+ D/ ~3 u# G- g
C S1S2
: @8 ~ c8 g+ t% a" B D S2S1( P( X# B4 a1 z \, Z$ ~% r
Q102 What would be the result of attempting to compile and run the following piece of code?
8 T2 U9 r: k7 \( E } public class Test {
7 e9 Y9 }7 o2 M! B8 _1 j. G static int x;
. H' z3 V j, V6 A public static void main (String args[])
+ W) n% w/ Q1 v1 m {2 K! ~$ ~4 B4 R$ r. R8 y
System.out.println(“Value is “ + x);
1 p& X% ~; y- l5 I. e' V }
# i/ g& Z! I8 t3 N }& ?6 I: a0 Z0 l7 O4 j! S
A The output “Value is 0 ” is printed.
* B1 F& h* `/ X) u1 q" p$ n B An object of type NullPointerException is thrown.
. g& @/ e# k0 ?+ C& }# R7 K& Q C An “illegal array declaration syntax” compiler error occurs.
1 g( o4 l' B* Y y D A “ possible reference before assignment” compiler error occurs.
+ K. W/ d, T7 u7 W Q100 D
e S+ G1 f. S& z& R Q101 C
. @ P; c+ {* [ Q102 A |