The following example shows how to implement instance specific methods with enum.
All enum types implicitly implements java.io.Serializable and java.lang.Comparable.
Enum provides the following APIs,
public final String name()
- Returns name of enum constant.
We can see that constructor is accepting shape area description as string argument and
provides an abstract method for enum constants to implement.
Each enum constant provides its own implementation of 'getArea' method.