🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← 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?

  1. A.Inner class
  2. B.Static nested class
  3. C.Anonymous class declared in an instance method
  4. 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 →