🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: Records and Sealed Classes: all 10 questions

Quiz: Records and Sealed Classes · Question 6 of 10

What does sealed interface Shape permits Circle, Square mean?

What does sealed interface Shape permits Circle, Square mean?

  1. A.Shape cannot have any implementations
  2. B.Only Circle and Square may implement Shape
  3. C.Circle and Square cannot have methods
  4. D.Shape can only be used inside one method
Answer & explanation

Correct answer: Only Circle and Square may implement Shape

permits gives the complete list of allowed direct subtypes.

Can you get the rest right without peeking?

Take the timed Quiz: Records and Sealed Classes quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →