re: NULL vs Empty VIEW POST

FULL DISCUSSION
 

Just wanted to clarify that the different Java compiler behaviors over instance variable vs local variable is not a result of inference, but as mandated by Java Spec.

 

Yes, that's why wrapped types (like Integer, Boolean) can be null. It is easy to make a mistake. I just wanted to show one way to get null pointer exception. There is lot of other cases also.

code of conduct - report abuse