Semester_2/OOP/Lab_06/Exercise3/Point2D.java
<gh_stars>0public class Point2D {
    protected float x = 0.0f;
    protected float y = 0.0f;

    public Point2D() {
    }

    public Point2D(float x, float y) {
        this.x = x;
        this.y = y;
    }

    public float getX() {
        return this.x;
    }

    public void setX(float x) {
        this.x = x;
    }

    public float getY() {
        return this.y;
    }

    public void setY(float y) {
        this.y = y;
    }

    public float[] getXY() {
        float[] xy = { this.x, this.y };
        return xy;
    }

    public void setXY(float x, float y) {
        this.x = x;
        this.y = y;
    }

    public String toString() {
        return "Point2D{" + this.x + ", " + this.y + "}";
    }
}