新手上路,这个3.1的Point怎么做

困惑的点在于如何用下面一串代码建立

class point
{
     double x,y;
         public Point(){
         x = 0 ;
         y = 0 ;
      }    
     public Point(double xx,double yy){
          x = xx;
          y = yy ;
      }
     public double getX(){
         return x ;
       }
     public double getY(){
         return y;
     }
}

img

写好了 你会采纳吗?

import java.util.Scanner;

class Point
{
     double x,y;
     public Point(){
         x = 0 ;
         y = 0 ;
     }    
     public Point(double xx,double yy){
          x = xx;
          y = yy ;
     }
     public double getX(){
         return x ;
     }
     public double getY(){
         return y;
     }
     public String toString() {
         return String.format("x=%.0f\ty=%.0f", this.getX(), this.getY());
     }
     public static void main(String[] args) {
         System.out.println(new Point(10, 20));
         System.out.println(new Point(30, 40));
         System.out.println(new Point(25, 45));
         System.out.printf("Press any key to continue...");
         new Scanner(System.in).nextLine();
     }
}