At page number 327 in Khalid Mughal's book
It is mentioned that
Static member classes and interfaces can only be nested within other static member or to level classes and interfaces
and i tried it as
but it is giving me compile time error and as per my understanding static dd() is a static member of class SuperA.
can anyone please clear my doubt or correct me.
Jehaan Butt
Ranch Hand
Joined: Feb 05, 2009
Posts: 41
posted
0
The static class must be declared WITHIN a class but OUTSIDE a method/constructor/block. Similar to an enum, I believe. Try putting the static class outside the method. The compiler will be happy.