Create a class called Date.java to perform error-checking on the initial values for instance: fields month, day and year. As well, give a method nextDay() to increment the day by one. The Date object must always remain in a consistent state.
Create a class called DateTest.java which prompts the user to enter the month, day, and year as numeric values. This program then makes a Date object by using the Date class you just created and tests the nextDay() method. This can be done in a loop of 40 iterations: the Date object calls the nextDay() method and prints the date during each iteration of the loop. This loop is to describe that the nextDay() method works correctly.
The attribute variables of a class require to be declared private.