Write a program to solve the Point problem.

Define a class of objects called Point (in the two-dimensional plane). 
A Point is thus a pair of two coordinates (x and y). Every Point should 
be able to calculate its distance to any other Point once the second point 
is specified. Here's an example of using the class:

  public static void main(String[] args) {
    Point a = new Point(3, 0); 
    Point b = new Point(0, 4); 
    System.out.println(a.distanceTo(b)); 
    System.out.println((new Point(1, 1)).distanceTo(new Point())); 
  }

should produce:

  5.0
  1.4142135623730951

Here's my program: 

  class Point {
    double x, y;
    Point(double x, double y) { this.x = x; this.y = y; }
    Point() { this(0, 0); }
    static Point origin = new Point(); 
    double distanceTo(Point other) {
      double dx = this.x - other.x;
      double dy = this.y - other.y;
      return Math.sqrt(dx * dx + dy * dy);
    }
  }