You have defined the following enum constants: enum Seasons { Winter, Spring, Summer, Fall }; In the
Fantastic news! We've Found the answer you've been seeking!
Question:
You have defined the following enum constants:
enum Seasons { Winter, Spring, Summer, Fall };
In the main method of the class Test, you have coded
Seasons.Fall = Autumn; // line 10
When you compile, you get the following message:
Test.java:10: error: cannot assign a value to final variable Fall Seasons.Fall = Autumn; // line 10 ^ Test.java:10: cannot find symbol Seasons.Fall = Autumn; // line 10 ^ symbol : variable Autumn location: class Test 2 errors
Explain what the problem is and how to fix it.
Posted Date: