上QQ阅读APP看书,第一时间看更新
Enum raw values
We saw how enums are defined and used. Enum cases can come with predefined values, which we call raw values. To create enums with raw values, the following rules should be adhered:
- All raw values should be in the same type.
- Inside the enum declaration, each raw value should be unique.
- Only possible values allowed to use are strings, characters, integer, and floating point numbers.