Question: b.equals(c) 4. Here is a simple Point and Circle class. class Point ( private double x, y; class Circle private Point c; /1 center private
b.equals(c) 4. Here is a simple Point and Circle class. class Point ( private double x, y; class Circle private Point c; /1 center private double r; // radius public Point (double x, double y) f this.x x; public Circle(Point c, double r) { this . r=r; this . y = y; this. c = c ; public double getX0f return x; > public double getYOf return y; h // more stuff (a) The constructor in Circle has a "privacy leak". Explain why. Hint: Consider the following code. Point p = new Point (1,2); Circle c= new Circle (p, 10); p.setX (100); (b) Rewrite the Circle constructor to fix this
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
