package ex1;

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
/**
 *
 * @author ttt
 */
public class Point {

    private int x;
    private int y;

    // common constructor
    public Point(int x, int y) {
        setX(x);
        setY(y);
    }

    // default constructor
    public Point() {
        this(0, 0);
    }

    // copy constructor
    public Point(Point point) {
        this(point.getX(), point.getY());
    }

    @Override
    public String toString() {
        return String.format("(%d, %d)", getX(), getY());
    }

    /**
     * @return the x
     */
    public int getX() {
        return x;
    }

    /**
     * @param x the x to set
     */
    public void setX(int x) {
        this.x = x;
    }

    /**
     * @return the y
     */
    public int getY() {
        return y;
    }

    /**
     * @param y the y to set
     */
    public void setY(int y) {
        this.y = y;
    }
}
