πŸ“Š JAVA
Q. What is the output of this program?
Code:
enum Levels 
{
    private machinA,
    public machinB,
    protected machinC;
}
  • (A) Compilation error
  • (B) Runtime error
  • (C) Exception EnumNotDefined
  • (D) It works well
πŸ’¬ Discuss
βœ… Correct Answer: (A) Compilation error

Explanation: Enum cannot have an access modifier. They are public, static and are final by default.

Explanation by: Admin
Enum cannot have an access modifier. They are public, static and are final by default.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
258
Total Visits
πŸ“½οΈ
4 y ago
Published
πŸŽ–οΈ
Admin
Publisher
πŸ“ˆ
83%
Success Rate