26 lines
450 B
Java
26 lines
450 B
Java
|
|
/**
|
|
* Beschreiben Sie hier die Klasse Punkt.
|
|
*
|
|
* @author (Ihr Name)
|
|
* @version (eine Versionsnummer oder ein Datum)
|
|
*/
|
|
public class Punkt
|
|
{
|
|
double x;
|
|
double y;
|
|
|
|
public Punkt(double _x, double _y) {
|
|
x = _x;
|
|
y = _y;
|
|
|
|
}
|
|
public void verschieben ( double _x, double _y ){
|
|
x = x + _x;
|
|
y = y + _y;
|
|
}
|
|
public String toString(){
|
|
return "P(" + x + "|" + y + ")";
|
|
}
|
|
}
|