Type a sealed class declaration with permits
Type a sealed class declaration with permits
Answer
sealed class Shape permits Circle, Rectangle { }
Only Circle and Rectangle may extend Shape. Any other class attempting to extend Shape gets a compile error. The permitted classes must be in the same package (or module).