In one of the questions on the Jxam mock exam, this code was given:
String s = null;
if ((s!=null) && (s.length()>0)) ...
The answer said a null pointer exception would be thrown because the entire expression had to be evaluated. But I thought the whole point of the shortcut operator && was that if the first condition was false ( and here it is because s is null ), you never looked at the second part. Am I missing something here or is the answer which is given incorrect/
Kathy