← Quiz: Nested and Anonymous Classes: all 10 questions
Quiz: Nested and Anonymous Classes · Question 1 of 10
Which kind of nested class can be created without an object of the outer class?
Which kind of nested class can be created without an object of the outer class?
- A.Inner class
- B.Static nested class
- C.Anonymous class declared in an instance method
- D.Local class declared in an instance method
Answer & explanation
Correct answer: Static nested class
A static nested class is not tied to any outer object: new Outer.Nested().
Can you get the rest right without peeking?
Take the timed Quiz: Nested and Anonymous Classes quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →