Hi,
This is what I know :
When you apply static modifier for a member of a class, it means that the member is not associated with a particular instance of the class it is contained. Rather, it is associated with the class itself.
static modifier can be applied to :
1. Inner class
2. Methods
3. Variables
4. Free floating blocks
1. static inner classes :
a. Cannot access instance variables of outer class.
b. Are not associated with instance of outer class unlike
nonstatic inner classes.
c. Are as good as top level classes with modified naming
syntax.
d. Can contain static variables unlike nonstatic inner
classes.
2. static methods :
a. Cannot access instance variables of the class.
b. Do not have "this" reference.
c. I think they don't have "super" reference either.
d. Cannot be overridden to be nonstatic.
e. Do not participate in dynamic binding.
f. Can contain a nonstatic/static inner class.
g. Cannot be abstract.
3. static variables :
a. Initialized when the class is loaded into JVM.
b. Are shared by all instances of the class.
4. static blocks :
a. Are executed only once : when the class is loaded into JVM.
b. Can access only static methods and variables.
c. Are executed in the order of their definition in the class.
You have asked to list the aspects of static modifier from exam point of view. Actually I am yet to take
SCJP. But I think we should know all these points. We can understand all these points well if we do some experiments with them.
Well, that is all I know. Anybody, please correct me if I am wrong. Add any other details you know.
Thanks
Milind