Java, Java8, Java21, Java17, Migration.
specify the classes that are allowed to inherit from Shape. //Defining Subclasses: public final class Circle extends Shape {...} public final class TransparentRectangle extends Rectangle {...} public final class FilledRectangle extends Rectangle {...} public non-sealed class Square extends Shape