Refer to the following declarations. public class Point { private double myX; private double myY;
Question:
Refer to the following declarations.
public class Point
{
private double myX;
private double myY;
// postcondition: this Point has coordinates (0, 0)
public Point()
{ /* implementation not shown */ }
// postcondition: this Point has coordinates (x, y)
public Point (double x, double y)
{ /* implementation not shown */ }
// other methods not shown
}
public class Circle
{
private Point myCenter;
private double myRadius;
// postcondition: this Circle has center at (0, 0) and radius 0.0
public Circle()
{ /* implementation not shown */ }
//postcondition: this Circle has the given center and radius
public Circle(Point center, double radius)
{ /* implementation not shown */ }
// other methods not shown
}
Which would be the best specification for a Circle method isInside that determines whether a Point lies inside this Circle?
Java How To Program Late Objects Version
ISBN: 9780136123712
8th Edition
Authors: Paul Deitel, Deitel & Associates