All pastes #346049 Raw Edit

Mine

public java v1 · immutable
·published 2007-02-09 01:08 UTC
rendered paste body
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()); }}