Inheritance restrictions

Interfaces

sealed interface IVehicle
    permits ITruck, Car {}

non-sealed interface ITruck extends IVehicle {}

final class Car implements IVehicle {}

//final class Helicopter implements IVehicle {} //<- error


In a sealed interface, you must immediately declare a list of inheriting classes, because there can be no inheritors other than them.