public class Test {
Integer i;
int j;
public static void main ( String [] args ) {
Test t = new Test ();
t.go();
}
public void go() {
j=i;
System.out.println(j);
System.out.println(i);
}
}
Output : Exception in thread "main" java.lang.NullPointerException at Test.go(Test.java:12) at Test.main(Test.java:8)