接口

sealed interface IVehicle
    permits ITruckCar {}

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.