This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
ObjectA contains a method [boolean IsIncluded()]which is supposed to return a boolean value.
But since the boolean value is not set into that variable which being returned by that method, neighter it is initialised.
As a consquence it returns 'null';
boolean isPresent = ObjectA.IsIncluded();
The aboce line where it is being called, throws java.lang.NullPointerException. Any suggetion how to avoid this null pointer Exception where it is being called ? Any idea on its type casting which may avodi this problem ?
A quick response would be highly appreciated.
thansk in advance,