Enums with Behavior

You can define abstract methods in Enum, since you cannot instantiate instances of Enum type. The implementation of those abstract methods are in the predefined constants. The constants may be called upon to carry out a certain type of behavior.

These are three Enum constants:

public enum ShuttleType {

        public Shuttle getShuttle() {
            return new Columbia();				
        public Shuttle getShuttle() {
            return new Discovery();			
    abstract Shuttle getShuttle();

They can be called upon like this:

public static void main(String[] args) {
    Shuttle s = ShuttleType.COLUMBIA.getShuttle();