Question: JAVA PROGRAM HELP: I need the following code. Write a class named Circle which represents a circle shape as described below: 1. Two attributes, color
JAVA PROGRAM HELP: I need the following code.

Write a class named Circle which represents a circle shape as described below: 1. Two attributes, color and radius. 2. A default constructor which initializes the attributes to red and 5, respectively. 3. A copy constructor. 4. A compareTo() method to determine if two Circle objects are the equal. Equality should be defined as the same color and the same radius. 5. A toString() method that returns the color and radius as a string. 6. A set function that allows the color of an object to be changed. 7. A set function that allows the radius of an object to be changed. Write a second class with a main function that declares two Circle objects: C1 and C2. Create a copy of C2 in a third object, C3 Compare the C1 and C2 and print the results. Change the color of C1. Compare C1 and C3 and print the results. Set the radius of C2 to 20. Print the results of toString() for C2
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
