I was trying some code on inner classes. It mentions that static variables can only be declared in static classes or top level classes.
I was just wondering, where else can static variables and methods be declared? Of course they are allowed in the class code and static methods. But cannont be declared in methods, construcors, non-static inner classes and anonymous classes.
You can create static variables or fields inside top level classes and static inner classes only. However you can create static constants i.e. final static fields inside other inner classes and interfaces...