Enum in Java Example

Posted on

Simple examples to demonstrate Enum in Java.

Simple Enum Example.

Test class for Enum.

Output

Enum with instance variable

Test class

Output

Iterating Enum constants with for loop

Output

Convert String in Enum Constant

Output

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.