Java aptitude question:
Predict the output:

public class Sookshmas
{
void m1()
{
System.out.println("m1 method");
}
class B
{
static int i=10; //Compilation fails at line 9
static final int j=20; //Compilation fails at line 10
void m2()
{
System.out.println("m2 method");
System.out.println(j);//Compilation fails at line 14
}
}
}
class Test
{
public static void main(String[] args)
{
Sookshmas a=new Sookshmas();
a.m1();
a.m2();//Compilation fails at line 24
Sookshmas.B ab=new Sookshmas().new B();
ab.m2();
}
}


Posted on by