package com.sf._04_泛型;

/**
 * point 存储横纵坐标信息
 * x y
 * xy  类型不是单一类型 可能String   Integer  double
 */
public class Point<T> {
    T  x;
    T  y;

    public Point() {
    }

    public Point(T x, T y) {
        this.x = x;
        this.y = y;
    }

    /**
     * 获取
     * @return x
     */
    public T getX() {
        return x;
    }

    /**
     * 设置
     * @param x
     */
    public void setX(T x) {
        this.x = x;
    }

    /**
     * 获取
     * @return y
     */
    public T getY() {
        return y;
    }

    /**
     * 设置
     * @param y
     */
    public void setY(T y) {
        this.y = y;
    }

    public String toString() {
        return "Point{x = " + x + ", y = " + y + "}";
    }
}
