Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Can someone answer the questions and explain why that is the answer. The Point Class l The Application (client) Program I/ Point class public class
Can someone answer the questions and explain why that is the answer.
The Point Class l The Application (client) Program I/ Point class public class Point implements Compaiable Point? public class PointTest privale double myx; private double myY publ'c static void ma n(Strnglargs) Point point1 Point point2; double distance; public Point) myx 0.0 myY = 0.0; coint1 new Point(5,6); r.oint2 new Point(-1,3); distance- point1.findDIstanceTo(point2): rublic Point double thex, double theY) sotPoint(thoX, the): System.out.printThe d'stance from+ pont1to"po'nt2); System-outprint(" is %.3Rna, distance): public double getx) return myX 1 ublic double getYo eturn myY publ'c Strng toString0 public double findDistanceTo(Point other) double ans, xDist, yDist; xDist-this.getx) -other.getXO: yDist this.getY- other getY); ans Math.sqrt(Math.pow(xDist,2) Math.powlyDist.2)) return ans; public void setPolnt(double x, double y) myx rublic int compaieTo(Point othet) return 0; I to be completed
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started