Q. What is the output of the below Java program with SWICH and ENUM?
Code:static enum ANIMAL {GOAT, TIGER, CAMEL}
public static void main(String args[])
{
ANIMAL ani = ANIMAL.CAMEL;
switch(ani)
{
case GOAT: System.out.println("GOAT");break;
case CAMEL: System.out.println("CAMEL");break;
case TIGER: System.out.println("TIGER");break;
}
}
β
Correct Answer: (A)
CAMEL