If I read the JLS §8.1.6 and §9.1.4 correctly, the classes that a sealed class/interface permits, are just the direct subclasses/interfaces. To illustrate this, consider the following example: If I understand the specification correctly, I1 obviously permits C and D but not E and F (via the extends hierarchy of I2 from I1). Is this correct? The reason I’m asking
Tag: sealed-class
What is the difference between Sealed class and inheritance principle in Kotlin?
I’m new with Kotlin. I’m reading a book and a sealed class is displayed there as an “extension” of Enum. I can’t see the similarity between them. The way I see the things, Sealed class is more related to inheritance, because each class can inherit from it and to add function and properties to it For example: I don’t see