Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Complete the following tasks in Java within the lab time using NetBeans. (JAVA) Create a class called Circle and has 1 instance variable, 1 class
Complete the following tasks in Java within the lab time using NetBeans. (JAVA)
Create a class called Circle and has 1 instance variable, 1 class variable declared as final and one object
radius as a Double
PI as Static, Final and Double
centerPoint as an object consisting of x and y
Your class should have a constructor that take the radius and centerPoint information. Your constructor should assign the values and create the centerPoint object (by calling its class constructor) .
provide a set and a get method for each instant variable
provide cloning method (override clone() method or create a copy constructor ), explain which cloning will you choose (Deep or shallow) and why
create a method area that computes and returns area of a circle.
provide JavaDoc documentation
Create centerPoint class that consists of two instance variables
X as Double
Y as Double
provide a constructor for this class that takes x and y information
provide a set and a get method for each instant variable
provide cloning method (override clone() method or create a copy constructor), explain which cloning will you choose (Deep or shallow) and why
Write a class called TestCircle with a main method in this method you will create an array that consists of 3 objects of class circle, one of these circles must be a clone is a clone.
Generate Java Doc , print circles information, then set the radius of the cloned circle to a new value and print information.
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