← 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?
- A.Shape cannot have any implementations
- B.Only Circle and Square may implement Shape
- C.Circle and Square cannot have methods
- 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 →