Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Compile Time Checking for NullPointerException

807580Oct 28 2009 — edited Oct 29 2009
I think Java should put a compile time checking for null pointer exception.

If an instance variable(object type) is declared but not assigned any value and it is private and then definitely the compiler should be able to flag an error or warning that an NullPointerException will be raised it any method is invoked on the object type instance variable.

It will help and save a lot of development effort since it will save the effort compile and running it once again to get the runtime NullPointerException.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 26 2009
Added on Oct 28 2009
14 comments
325 views