Question: A. (1 point) Write a minimal definition for a class named Monthday, about which you know nothing else (that is, don't use the information in

 A. (1 point) Write a minimal definition for a class named

A. (1 point) Write a minimal definition for a class named Monthday, about which you know nothing else (that is, don't use the information in the following questions in this answer). Your answer to this question should be just the minimal definition - it will be really short! B. (2 points) Add a constructor for Monthday that takes a month and day (of the appropriate primitive type), and stores these values in appropriately-named instance variables. If the month or day is obviously invalid, then your constructor should throw an IllegalArgumentException. Do not exhaustively check correctness. Instead, limit your checks to checking for a day greater than zero, and a month between 1 and 12 inclusive. Your answer should be the entire class definition. C. (1 point) Write a public tostring() method with an appropriate signature that converts the MonthDay object to a String representation as exemplified by "31 January" or "4 March". Your answer should be just the toString() method

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!