|
|
|
|
Java 5.0 improved the situation a great deal by introducing true, type-safe,
which outputs: Size: LARGE Furthermore, in the second example above, if you tried to do: size = 75; you would get a compilation error: "EnumTest.java": incompatible types;
found : int, required: examples.EnumTest.Size
This allows you to write code that is more self-describing, and much safer! |
|
This page was last modified on 02 October, 2007 |