Multiple choice technology

Which statement is true about a static nested class? 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 nonstatic members of the enclosing class. C. It's variables and methods must be static. D. It must extend the enclosing class.

  1. D

  2. C

  3. B

  4. A

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

Static nested classes are associated with the enclosing class itself, not an instance, so they can be instantiated without a reference to an enclosing class instance (A is false). They can only access static members of the enclosing class (B is true, C is false). They do not need to extend the enclosing class (D is false).