📜  java中的点类是什么? - Java 代码示例

📅  最后修改于: 2022-03-11 14:52:11.556000             🧑  作者: Mango

代码示例1
public class Point {
private double x;
private double y;

public Point(double x, double y){
    this.x=x;
    this.y=y;
}public String toString(){
    return "("+ this.x+","+this.y+")";
}
public static void main(String[] args){
    Point point= new Point(3,2);
            System.out.println(point.tostring());
    }
}