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

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!