Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumJavasealed types usageSingle-choice MCQ

Given this sealed hierarchy, which statement about the permitted subtypes is TRUE?

public sealed interface Shape permits Circle, Square, Outline {} public final class Circle implements Shape {} public record Square(double side) implements Shape {} public non-sealed class Outline implements Shape {}