Q. What is the output of the below Java program with Enums?
Code:
enum Car
{
SEDAN, HATCHBACK, SUV
}
public class EnumTest1
{
public static void main(String[] args)
{
Car c1 = Car.SEDAN;
System.out.println(c1.name() + ", " + c1);
}
}
β
Correct Answer: (C)
SEDAN, SEDAN