I got as far as setX and then got stuck.
I'm not really looking for someone to solve it for me. I just want to know what topics I should study so I can understand how to write these equations myself.
Method named distance without any parameters, it needs to return the distance between this Point and Point (0, 0) as a double.
Method named distance with parameter of type Point, it needs to return the distance between this Point and the parameter Point as a double.
Method named distance with two parameters x, y both of type int, it needs to return the distance between this Point and Point x, y as a double.
How to find the distance between two points?
To find a distance between points A(xA,yA) and B(xB,yB), we use the formula:
d(A,B)=√ (xB − xA) * (xB - xA) + (yB − yA) * (yB - yA)