Quantcast
Channel: Examples Java Code Geeks » Enum
Viewing all articles
Browse latest Browse all 5

Each Enum Instance a different sub-class

$
0
0
In this example we shall show you how to have each enum instance represent a different sub-class. To make each enum instance represent a different sub-class one should perform the following steps: Create an enum with different enum constants. Give each enum constant a different behavior for some method. Declare the method abstract in the enum ...

Viewing all articles
Browse latest Browse all 5

Trending Articles