if (radius < 0)
und if (width < 0 || height < 0)
eine Exception statt eines outWOW! Vielen vielen Dank dass du dir meinen Code angeschaut hast
Meinst du so:
public class Geometry implements Comparable<Geometry> {
private final intid = -1;
private final booleanfilled = false;
private final String color = "";
private final doublewidth = 0;
private final doubleheight = 0;
bei alle Felder final?
private final int id = -1;
sondern nur private final int id;
. Das initialisieren dann im Konstruktor machen