Modify the set methods in class Time2 of Fig. 8.5 to return appropriate error values if an attempt is made to set one of the instance variables hour, minute or second of an object of class Time to an invalid value. [Hint: Use boolean return types on each method.] Write a program that tests these new set methods and outputs error messages when incorrect values are supplied.
Please see attachments for full problem details.© BrainMass Inc. brainmass.com June 3, 2020, 8:10 pm ad1c9bdddf
In order to test if user supplies a wrong value for hour, minute and second three private boolean variables were introduced in ...
The solution illustrates how to return error conditions from Java methods using an example (see attachment).