πŸ“Š JAVA
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);
  }
}
  • (A) SEDAN,
  • (B) SEDAN, 0
  • (C) SEDAN, SEDAN
  • (D) None of the above
πŸ’¬ Discuss
βœ… Correct Answer: (C) SEDAN, SEDAN

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
241
Total Visits
πŸ“½οΈ
4 y ago
Published
πŸŽ–οΈ
Ram Sharma
Publisher
πŸ“ˆ
92%
Success Rate