X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2FWeight.java;h=5e33327fac7ec77eac23a14ec0aa46a6b4e65342;hb=62e26730c12aa80689e068908090d801869ab701;hp=e79d1025a9e35977344ab5003e129df1aa88ff03;hpb=613054ac3144a04ab284e159b610317eacf67e1f;p=Persons_Comparator.git diff --git a/src/Weight.java b/src/Weight.java index e79d102..5e33327 100644 --- a/src/Weight.java +++ b/src/Weight.java @@ -1,6 +1,9 @@ public class Weight implements Comparable { private int weight; + Weight() { + } + Weight(int weight) { setWeight(weight); } @@ -23,7 +26,7 @@ public class Weight implements Comparable { @Override public int compareTo(Weight weight) { - int distance = weight.weight - this.getWeight(); + int distance = weight.getWeight() - this.getWeight(); if (distance >= 0) return distance; else