Question: Can someone provide an example of a mutator method that updates if it is a valid date an error statement using if/else statement in Java?

Can someone provide an example of a mutator method that updates if it is a valid date an error statement using if/else statement in Java?
12. Now we will add a mutator method that sets the date to something else. 13. Write a method public void setDate(int dayIn, int monthIn, int yearIn){} 14. Update the attributes with these values only if it is a valid date. Otherwise print an error statement using: System.out.println()
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
