I have to implement a class which represents a 2-d geometrical point and for my main program it is: public static void main(String[] args){
Point p=new Point();
System.out.println(p);
Point q=new Point(3,4);
System.out.println(p);
System.out.println(distance(p,q));
p.translate(2,3);
q.SetLocation(7,15);
System.out.println(p.distance(q));
i am having trouble figuring out what other codes to enter to make this work, the output should be:
Point [0.0,0.0]
Point[3.0,4.0]
5.0
13.0
HELP?
Comments
Leave a comment