autoboxing ,unboxing static variable
//Static variables by default initialized with null,
// which can’t be autoboxing/ autounboxing.Hence RTE
class StaticDe
{
static Integer I1; // not Initialized
public static void main(String a[])
{
m1(I1); // null pointer exception
}
public static void m1(int i)
{
Integer I2=i;
System.out.println(I2);
}
}
0 comments:
Post a Comment