코멘트 (1)
  • 인기
  • 신규
  • 이전
코멘트를 남기려면 로그인 해야 합니다
Mack
레벨 20 , Osiedle-Nowiny, Poland
14 December 2018, 22:15
How did you do task 1714 "Comparable" ? I have problem with method ComareTo().. @Override public synchronized int compareTo(Beach o) { float f = Float.compare(this.distance, o.distance); int i = Integer.compare(quality, o.quality); return (f==0 && i==0)? 0 : 1; } Validator: The Beach class's compareTo method should at least account for beach quality and distance. Be sure that x.compareTo(y) == -y.compareTo(x) Be sure that compareTo returns different values for different objects.