|
Class-Enum Hybrids
An Introduction with Examples in Java |
|
Prof. David Bernstein
|
| Computer Science Department |
| bernstdh@jmu.edu |
Color class
contains instances like Color.RED,
Color.GREEN, ...)Color class that includes
an instance that couldn't be represented by the color model
being used; an upper/lower bound on an ordered set that is
not an element of the set)
Temperature objects for equipment that
can be used for heating and/or cooling
public:
final:
static:
== (though can
be compared with the equals() method)equals()
methodequals()
methodequals() Method Revisited
enum
Month Enum as a Class
compareTo()
ordinal()
valueOf()
values()
Month Class