Classes and Objects: Methods 3
public double
distance(Point that) {
double xdiff = x - that.x;
double ydiff = y - that.y;
return Math.sqrt(
xdiff*xdiff + ydiff*ydiff);
}
Previous slide
Next slide
Back to the index
View Graphic Version
Notes:
No notes for slide 19