What is the purpose of empty class in Kotlin?

后端 未结 6 1659
無奈伤痛
無奈伤痛 2021-01-04 21:08

I was going through Kotlin reference document and then I saw this.

The class declaration consists of the class name, the class header (

6条回答
  •  情歌与酒
    2021-01-04 21:33

    Sealed classes, in a sense, an extension of enum classes: the set of values for an enum type is also restricted, but each enum constant exists only as a single instance, whereas a subclass of a sealed class can have multiple instances which can contain state. reference

提交回复
热议问题