You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
456 B

  1. class IntComparable implements Comparable<IntComparable> {
  2. private int value;
  3. IntComparable(int value) {
  4. this.value = value;
  5. }
  6. @Override
  7. public int compareTo(IntComparable other) {
  8. return Integer.compare(this.value, other.value);
  9. }
  10. @Override
  11. public String toString() {
  12. // Verwenden Sie eine geeignete String-Darstellung, zum Beispiel den Wert selbst
  13. return Integer.toString(value);
  14. }
  15. }