πŸ“Š JAVA
Q. What will be the output of the following Java code snippet?
enum Enums
{
A, B, C;

private Enums()
{
System.out.println(10);
}
}

public class MainClass
{
public static void main(String[] args)
{
Enum en = Enums.B;
}
}
  • (A) 10 10 10
  • (B) Compilation Error
  • (C) 10 10
  • (D) Runtime Exception
πŸ’¬ Discuss
βœ… Correct Answer: (A) 10 10 10

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
116
Total Visits
πŸ“½οΈ
1 y ago
Published
πŸŽ–οΈ
Ram Avtar Sharma
Publisher
πŸ“ˆ
96%
Success Rate