Question: Consider the aggregated Circle class and the Point class public class Circlet { private point center; private int radius; public Circle(Point c, int r) {
Consider the aggregated Circle class and the Point class public class Circlet { private point center; private int radius; public Circle(Point c, int r) { center = c; radius = r; } public Point getCenter( ) { return center; } } public class Point{ private int x, y; public Point(int x, int y) { this.x = x; this.y = y; } public Point getx() { return x; } public int gety() { return y; } } Show the statement(s) required to create a new Circle object Identify any data leaks in the Circle class and rewrite the appropriate code to use deep copy and deep return instead of the shallow references
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
