code:
class Hat{
int k=20;
int l=100;
private int m=56;
class Qute{
int show() {System.out.println(m);
return m;}
}
class Hello{
void display() {
//int d=Qute.show();----------line 1
System.out.println(d);}
} }
class Hate{
public static void main(
String args[ ]){
Hat.Qute t=new Hat().new Qute();
t.show();
Hat.Hello j=new Hat().new Hello();
j.display();
}
}
why is line 1 giving a compiler error...as per my knowledge a non static member class can directly refer to any member(including nested)of the enclosing class..