If the newWord is null ,it should not go in the loop,but why does it go inside the loop and gives java.lang.NullPointerException
newWord = "abcd";
while(!newWord.equals(null))
{
try {
newWord = br.readLine();
} catch (IOException e) {
// TODO Auto-generated catch block
}
catch(NullPointerException p)
{
}
}
It gives the stacktrace but i have not used printStackTrace() anywhere