Page 1 of 1

About Question enthuware.ocajp.i.v7.2.1342 :

Posted: Mon Jul 22, 2013 9:37 am
by ewebxml
For this question,
did the writer accidentally use s.length instead of str.length in the explanation?
"s.length() throws NullPointerException" should be
"str.length() throws NullPointerException"

// The following is the text extract from the explanation
1. Say  str = null; for a, the first part is false and str.length() throws NullPointerException because s is null.
for b, the first part of it is true but it will still evaluate the second part  and as str is null,
s.length() throws NullPointerException.
Had it been || instead of |, the second part would not have been evaluated and no exception would have been thrown.

Re: About Question enthuware.ocajp.i.v7.2.1342 :

Posted: Tue Jul 23, 2013 8:16 am
by admin
Yes, it should be str. This has now been fixed.

thank you for your feedback!