Menu
Question Index
...

What will be the output of the following program?

public class WeekDays {
    public enum Days {
        MON, TUE, WED, THU, FRI, SAT
    };
    public static void main(String[] args) {
        for (Days d : Days.values());
        Days[] d2 = Days.values();
        System.out.println(d2[2]);
    }
}


TUE
WED
Some other output
Output can not be determined
Compilation Error or Runtime Error

Doubts

Problems

Topic: Java Enumeration

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App