Here :

```
class Point{
int x;
int y;
.....
.....
public double distance(int x, int y) {
double d = Math.sqrt( Math.pow(x2-x1, 2) +
Math.pow(y2-y1, 2) ); //ERROR IN THIS LINE
return distance; //ERROR HERE TOO...(2)
}
}
```

There is no x1,x2,y1,y2 defined in the class or
in the method parameter.

Swap it with the following line:

double d = Math.sqrt( Math.pow(this.x-x, 2) +
Math.pow(this.y-y, 2) );

(2)
Error 2 Swap with this line:

return d;