Given:
3. public class Main { 4. public enum Days { MON, TUE, WED }; 5. public static void main(String[] args) { 6. for(Days d : Days.values() ) 7. ; 8. Days [] d2 = Days.values(); 9. System.out.println(d2[2]); 10. } 11. }
What is the result?
Choose all that apply.
B is correct.
Every enum comes with a static values()
method that returns an array of the enum's values, in the order in which they are declared in the enum.
A, C, D, E, F, and G are incorrect.