public class Point {
    public double x;
    public double y;
    private static int num = 0;

    public Point(double x, double y) {
        this.x = x;
        this.y = y;
        ++num;
    }

    public Point() {
        this(0.0, 0.0);
    }

    public double distanceTo(Point other) {
        return Math.sqrt(
            Math.pow(other.x - this.x, 2) + Math.pow(other.y - this.y, 2)
        );
    }

    public String toString() {
        return String.format("(%.2f, %.2f)", this.x, this.y);
    }

    public static int getNum() {
        return num;
    }

    protected void finalize() throws Throwable {
        --num;
        super.finalize();
    }
}

@@ -59,40 +59,8 @@
 e y;
-%0A    private static int num = 0;
 %0A%0A  
@@ -140,23 +140,8 @@
  y;%0A
-        ++num;%0A
     
@@ -459,164 +459,7 @@
    %7D
-%0A%0A    public static int getNum() %7B%0A        return num;%0A    %7D%0A%0A    protected void finalize() throws Throwable %7B%0A        --num;%0A        super.finalize();%0A    %7D
 %0A%7D%0A

remove unused functionality