public void go(){ j=i; //line 7 System.out.println("value of j :"+ j); System.out.println("value of i :"+ i); }
public static void main(String[] args) { Ex obj=new Ex(); obj.go();
}
} /[code] in code above i set Integer i=0; then unboxing will occur at line 7. in your code Integer i is null so there is NullpointException. Boxing will occur when Integer i will refer to some Object. But in your code Integer i donot refer to any object so boxing will not occur.
in code above i set Integer i=0; then unboxing will occur at line 7. in your code Integer i is null so there is NullpointException. Boxing will occur when Integer i will refer to some Object. But in your code Integer i donot refer to any object so boxing will not occur.
And tomorrow is the circus! We can go to the circus! I love the circus! We can take this tiny ad:
a bit of art, as a gift, that will fit in a stocking