How are we able to access static member of normal Inner class without creating an Outer class object in JAVA?
Because Inner class is like an instance member of Outer class, an Outer class Object is required to access its instance members.
I mean how are we able to access directly inner class: Inner.m1() without Outer class Object? (Not talking about accessing m1() directly using inner class name as it is static)
class Outer
{
class Inner
{
static void m1()
{
}
}
public static void main (String[] args)
{
Inner.m1(); // NO C.E !
}
}
Best regards.