Typesafe Enumerations
- enum equivalent to class with fixed number of instances
public class Size
{
private /* ! */ Size() { }
public static final Size SMALL = new
Size();
public static final Size MEDIUM = new
Size();
public static final Size LARGE = new Size();
}
- enum types are classes; can add methods, fields,
constructors