What is `sealed` interface combined with `non-sealed` permitted subtype in Java 17+?

Java Professional Hard

Java Professional — Hard

What is `sealed` interface combined with `non-sealed` permitted subtype in Java 17+?

Key points

  • `sealed` interface controls which classes can be subtypes
  • `non-sealed` allows specific subtypes to be extended by any class
  • This combination balances hierarchy control with open extension

Ready to go further?

Related questions