</p> 11. Q3 a = new Q3();
3 ~4 T+ M* p# N- R 12. }
- Y/ |* |8 E" o, z) ]( ~2 T 13 }2 Q4 r) H+ Z) M; X# [" {1 ?
a. Compilation error at line 2.# p6 ]/ B3 w+ {$ M& c" _
b. Compilation error at line 7.
3 {* y# C/ K1 P! D c. No compilation error, but runtime exception at line 2.
9 j5 F! L. r+ V$ ]0 Q8 F/ s d. No compilation error, but runtime exception at line 7.
, y! q+ \ d. n# b$ B Q12.What will happen if you compile/run the following code?
6 F* T# w' l4 ` T# ~* i 1. public class Q21 {/ ]" ?) b5 V) B, d% X
2. int maxElements; t2 X4 k/ K+ b% I
3. void Q21() {6 h2 J1 w" {+ U8 f6 o0 Q& E6 d* ^# b
4. maxElements = 100;) ^3 m0 \/ M, H' U+ S
5. System.out.println(maxElements);
, O5 w! i. U0 x7 f/ U- a 6. }8 b. ]7 ?* `( n
7. Q21(int i) {) B* I- B( \/ A% O, d% z5 D
8. maxElements = i;) K0 G8 ?3 f; U _ m3 G
9. System.out.println(maxElements);
) z: _! o. y3 h/ w" L7 A1 J2 \( V 10. }! c% C) C( I5 N) p8 V9 t9 G
11. public static void main(String[] args) {/ `+ y' [( p: ^/ B0 h1 k) [
12. Q21 a = new Q21();
4 @+ b+ j q$ w, Z 13. Q21 b = new Q21(999);5 i+ ]8 e, H3 a; l$ a, `" K
14.: r/ m2 [( M- ^) W" r1 W
15. }7 D2 ~* b# F. I1 A, V
16. }
1 R3 f4 Z7 u- H" E a. Prints 100 and 999.
^3 y: Y; `) T/ j7 |9 {+ [ b. Prints 999 and 100.
/ g! W# o0 A" `* n: o' f6 m c. Compilation error at line 2, variable maxElements was not initialized.
& }1 [' U; X$ k. i: R d. Compilation error at line 12.
# ~* I% J8 i1 n 10. b
4 l9 z" i( g! V$ j3 K0 p7 e 11. b
( C6 b- r! ~' B! w; b# D8 I 12. d |