Mohamed Magdy wrote:
haha i'm still a beginner.anyway i got it thanks
fix:
public boolean compare(Time time){
Yup...I figured as much.
We don't like to GIVE the answers...I was trying to hint at it so that you would find it yourself. You are much more likely to remember it next time something like this comes up.
Well done!!
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Why are you using a boolean return on a compare method? That would tell you whether the two times are the same, not whether t1 is earlier or later than t2.
How did you work out the logic for adding seconds? What will happen if you add 120 seconds? That is two minutes. I would have thought the minutes variable increases by 2 and the seconds variable stays unchanged.
The moth suit and wings road is much more exciting than taxes. Or this tiny ad:
a bit of art, as a gift, that will fit in a stocking