Given the following definition:
String s = null;
Which code fragment will cause an exception of type NullPointerException to be thrown.
(A) if ((s != null) & (s.length()>0))
(B) if ((s != null) && (s.length()>0))
(C) if ((s != null) | (s.length()>0))
(D) if ((s != null) | | (s.length()>0))
Can anybody tell me what answers are true? And what are the reasons?