posted 18 years ago
Hi All,
Can anyone tell me why answer C is not correct ? Once entire class is static, shouldn't be all members static too ?
The following question was extracted from K&B Book. (Correct answers are as bold)
Which are true about a static nested class? (Choose all that apply.)
A. You must have a reference to an instance of the enclosing class in order to instantiate it.
B. It does not have access to non-static members of the enclosing class.
C. Its variables and methods must be static.
D. If the outer class is named MyOuter, and the nested class is named MyInner, it can be instantiated using new MyOuter.MyInner();.
E. It must extend the enclosing class.
"If someone asks you to do something you don't know how to, don't tell I don't know, tell I can learn instead." - Myself