The following program
public class Test {
public static void main(String[] args) {
try
{
String t = null;
t.toString();
} catch(Exception e) {
e.printStackTrace();
}
}
}
Prints in console:
java.lang.NullPointerException at Test.main(Test.java:9)
And the following program
public class Test {
public static void main(String[] args) {
String t = null;
t.toString();
}
}
Prints in console:
Exception in thread "main" java.lang.NullPointerException at Test.main(Test.java:7)
What is the difference between these two console prints?