Kotlin 1.2 Language Documentation
most basic usage of enum classes is implementing type-safe enums: enum class Direction { NORTH, SOUTH, WEST, EAST } Each enum constant is an object. Enum constants are separated with commas. Since each0 码力 | 333 页 | 2.22 MB | 1 年前3Kotlin Language Documentation 1.3
most basic usage of enum classes is implementing type-safe enums: enum class Direction { NORTH, SOUTH, WEST, EAST } Each enum constant is an object. Enum constants are separated with commas. Since each0 码力 | 597 页 | 3.61 MB | 1 年前3Kotlin Language Documentation 1.9.20
tab and select the Use trailing comma option. Enumerations enum class Direction { NORTH, SOUTH, WEST, EAST, // trailing comma } Value arguments fun shift(x: Int, y: Int) { /*...*/ } shift( case for enum classes is the implementation of type-safe enums: enum class Direction { NORTH, SOUTH, WEST, EAST } On the JVM, if the object is an instance of a functional Java interface (that means0 码力 | 1299 页 | 32.44 MB | 1 年前3Kotlin 1.9.10 官方文档 中文版
Style | Kotlin, 打开 Other 选项卡并选择 Use trailing comma 选 项。 枚举 enum class Direction { NORTH, SOUTH, WEST, EAST, // 尾部逗号 } 值实参 fun shift(x: Int, y: Int) { /*……*/ } shift( 25, ActionListener { println("clicked") } 枚举类 枚举类的最基本的应用场景是实现类型安全的枚举: enum class Direction { NORTH, SOUTH, WEST, EAST } 每个枚举常量都是一个对象。枚举常量以逗号分隔。 因为每一个枚举都是枚举类的实例,所以可以这样初始化: enum class Color(val rgb: Int)0 码力 | 3753 页 | 29.69 MB | 1 年前3Kotlin 官方文档中文版 v1.9
Kotlin, 打开 Other 选项卡并选择 Use trailing comma 选项。 枚举 编码规范 416 enum class Direction { NORTH, SOUTH, WEST, EAST, // 尾部逗号 } 值实参 fun shift(x: Int, y: Int) { /*……*/ } shift( 25, println("clicked") } 嵌套类 522 枚举类 枚举类的最基本的应用场景是实现类型安全的枚举: enum class Direction { NORTH, SOUTH, WEST, EAST } 每个枚举常量都是一个对象。枚举常量以逗号分隔。 因为每一个枚举都是枚举类的实例,所以可以这样初始化: enum class Color(val rgb: Int)0 码力 | 2049 页 | 45.06 MB | 1 年前3
共 5 条
- 1