Question: Modify the TimeSpan class from Chapter 8 to include a compareTo method that compares time spans by their length. A time span that represents a
Modify the TimeSpan class from Chapter 8 to include a compareTo method that compares time spans by their length. A time span that represents a shorter amount of time is considered to be “less than” one that represents a longer amount of time. For example, a span of 3 hours and 15 minutes is greater than a span of 1 hour and 40 minutes.
Step by Step Solution
3.45 Rating (165 Votes )
There are 3 Steps involved in it
first implementation hours and minutes fields public class TimeSpan implements Comparable p... View full answer
Get step-by-step solutions from verified subject matter experts
