Click here to watch in Youtube :
https://www.youtube.com/watch?v=1f_xnkZQ7m4&list=UUhwKlOVR041tngjerWxVccw
enum Operation
{
PLUS, MINUS, MULTIPLY, DIVIDE;
}
public class EnumDemo
{
public static void main(String[] args)
{
Operation[] operationArray = Operation.values();
/*
* To loop a Enum object.
*/
for (Operation operation : operationArray)
{
System.out.println(operation);
}
}
}
OutputPLUS
MINUS
MULTIPLY
DIVIDE
Click the below link to download the code:
No comments:
Post a Comment