- 说明
枚举类:需要继承Enumeration
应用类:需要继承App, 自带main方法, 能直接执行
- 案例实操 ```scala object Test { def main(args: Array[String]): Unit = { println(Color.RED) } }
//枚举类 object Color extends Enumeration { val RED = Value(1, “red”) val YELLOW = Value(2, “yellow”) val BLUE = Value(3, “blue”) }
//应用类 object Test20 extends App { println(“xxxxxxxxxxx”); }
```