Question: Question 3. (9 pts) The following class represents an interval of time between two Dates. public class Interval ( private Date start; private Date stop;

Question 3. (9 pts) The following class represents an interval of time between two Dates. public class Interval ( private Date start; private Date stop; private long duration; // Rep invariant: duration stop.getTime() - start.getTime() public Interval (Date start, Date stop) i this. start = start; this, stop = stop ; duration = stop. getTime() - start. getTime(); public Date getstart) f return start; 1 public Date getstop) l return stop; 1 public long getDuration ) l return duration; h Willy Wazoo argues that the rep invariant of Interval always holds, because duration is initialized once in the constructor, to the correct value. Give all reasons why Willy is wrong
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
