Enumerated Types
- Finite set of values
- Example: { SMALL, MEDIUM, LARGE }
- Java has no syntax for enumerated types
- Can fake them with integer constants
public static final int SMALL = 1;
public static final int MEDIUM = 2;
public static final int LARGE = 3;
- Not typesafe
int size = LARGE;
size++;
previous |
start |
next .... [Slide 7] ....