Created by
Ettar
| public class Punkt {
private double x;
private double y;
public Punkt(double x, double y){
setX(x);
setY(y);
}
public void setX(double x) {
this.x = x;
}
public void setY(double y) {
this.y = y;
}
public double getX() {
return x;
}
public double getY() {
return y;
}
}
|
| public class PunktTest{
public static void main(String[] ARGS){
Punkt nP = new Punkt(2.0,3.0);
System.out.println(nP.getX() + " " + nP.getY());
nP.setX(4.0);
nP.setY(7.0);
System.out.println(nP.getX() + " " + nP.getY());
}
}
|