public class Punkt { private float x, y ; private int nummer ; static int anzahl = 0 ; public Punkt () { x=0; y=0; nummer=++anzahl; } public Punkt (float x1, float y1) { x=x1; y=y1; nummer=++anzahl; } public float getX () { return this.x ; } public float getY () { return this.y ; } public int getNummer () { return this.nummer ; } public int getAnzahl () { return anzahl ; } public Punkt verschiebe (int dx, int dy) { return new Punkt(this.x+dx,this.y+dy); } public void print() { System.out.println("Der Punkt ("+getX()+getY()+") hat die nummer "+getNummer()+" von "+getAnzahl()); } }