No More NullPointerException in Java

Finally the day has arrived, and parents of Java have heard the cry of millions of developers, who have been struggling for years with this exception – NullPointerException. Java will no longer throw NullPointerException. This exception will be removed from coming Java versions. The only apparent presence of pointers in Java will be removed with this decision. Hence it is party time for all junior and mature developers.

Developers are saying that they migrated to Java from C and C++, more after hearing the word garbage collection, than object oriented language. But, after learning Java, they found, more attention required to this exception, and memory management, than actually functionality. There are very few developers, who can write tens of lines of code, without ending up in Null Pointer Exception. It has been troubling even in the application, products that are already in production. Many business users also found it annoying to get this exception with so much of trace on screen.


This exception also contributed to defensive coding practice, where developers had to flood their code with null check if statements. It reduced productivity of developers considerably and made developers to worry more about null values than focusing on logic implementation. There is also argument, if all null possibilities should be solved using null check, or it can lead to some design changes as well.

Many tools are also in market just to inspect possibility of this exception, which will have to find more serious inspection possibilities in Java code than this one.

Java also tried to counter trouble of this exception to some extent by introducing auto-boxing in Java 5 release. But it still has failed to solve the complete pain of this basic memory management. Java also needs to think about the competing languages like Groovy, which handle this null value problem automatically.

Hence, finally they have decided to get rid of possibility of throwing NullPointerException. For all Java developers, it is not sure when they will actually get freedom from this exception, but they can surely celebrate after reading this news.

More intresting faking news to follow in this “Fake Tech News” section.


Leave a Reply

Your email address will not be published.