import java.util.EnumSet;
public final class EnumMeg
{
public static void main(String[] args)
{
Integer i = null;
method(i);
}
static void method(int k){
System.out.println(k);
}
}

It will compile but will throw a NullPointerException at runtime.

  • Share/Bookmark

class box
{
int height;
int weight;

box( int a, int b)
{
height=a;
weight=b;
System.out.println(height);
System.out.println(weight);
}

}

class Box2
{
public static void main(String args[])
{
Box2 b2=new box();
}
}

  • Share/Bookmark