Interview Preparation mode beta
Funny Facebook Status Funny Facebook Status
Enter your email address

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

Nice?Vote!
What can go wrong if you replace && with & in the following code: String a=null; if (a!=null && a.length()>10) {...}
asked 1 year ago in Java Interview Questions and Answers by anonymous

1 Answer

Nice?Vote!
A single ampersand here would lead to a NullPointerException.
answered 1 year ago by anonymous

Related questions