DEVFYI - Developer Resource - FYI

What can go wrong if you replace &emp;&emp; with &emp; in the following code: String a=null; if (a!=null && a.length()>10) {...}

Java Interview Questions and Answers (part 1)


(Continued from previous question...)

45. What can go wrong if you replace &emp;&emp; with &emp; in the following code: String a=null; if (a!=null && a.length()>10) {...}

A single ampersand here would lead to a NullPointerException.

(Continued on next question...)

Other Interview Questions