You have a public enum class named Month. Its members are constants that represent the months of the year.
You have a public class named MonthTest.
The MonthTest class has
- An instance variable of type Month named month.
- A month setter method named Month(). I think that "Month" is a terrible choice for a method in this class, since we mere humans might get confused by the existence of an enum class with the same name. Since this method's purpose is to give a value to the instance variable month, why not call it setMonth() or some such thing?
- A method named tellItLikeItIs() that prints out the information about the value of the month instance variable.
- A main method that has a loop that lets the variable d take on values from the Month enum class.
So, here's one way to complete the assignment using the classes and their variables and methods that you have already defined.
- In main(), create an MonthTest object. Call the object mt or some such thing. (Maybe you can think of a name that is more descriptive and less cryptic.)
- Inside the loop that lets d go through the values of the Month enum:
- Use the month setter method of the mt object to set its instance variable month to the value of d
- Use the tellItLikeItIs() method of the mt object to print the information.
Cheers!
Z