16. Consider the following code:
1 |; X( l& W' V+ ?) y/ hString s = null;* P) c4 R1 K; {6 c+ D3 h
Which code fragments cause an object of type NullPointerException to be thrown?: [9 K9 [ v# Z# O6 ^/ `5 t
A.if((s==null) & (s.length()>0))
" [! `0 p1 |8 `9 AB.if((s==null) &&(s.length()>0))
" Z, a; _3 Z7 f: k& n; G$ {# UC.if((s!=null) | (s.length()==0))! m0 q" K: U( [
D.if((s!=null) || (s.length()==0))
; Y9 R- v# d, T8 J4 b! aABCD.
0 t, _( ~! e K5 f6 m. ~6 D17. Which statement is true about an inner class?& V$ U9 Z3 M& e5 g1 n
A. It must be anonymous* D9 Z5 |+ n+ ]# |! ?0 l0 e1 B3 g
B. It can not implement an interface B2 A) \' u3 n
C. It is only accessible in the enclosing class2 @& R2 {$ F0 ?! E8 {
D. It can only be instantiated in the enclosing class
8 t; p; m" f$ V! ]/ OE. It can access any final variables in any enclosing scope.2 j3 H$ V8 Y. E" A/ a
E.
% u4 u; {4 S' p18. Which statements are true about threads?. Y W+ l9 M+ k
A. Threads created from the same class all finish together3 u8 k$ O$ X! y# j G
B. A thread can be created only by subclassing Java.Lang.Thread.9 T! H& F3 m6 d: r8 M
C. Invoking the suspend() stops a thread so that it cannot be restarted8 a1 M3 Z$ M0 z! V) W2 l
D. The Java Interpreter's natural exit occurs when no non daemon threads remain alive$ q# V" v9 S' q _
E. Uncoordinated changes to shared data by multiple threads may result in the data being read, or left, in an inconsistent state.9 l) A" k( ?% D. l+ W& P6 E
DE. |