Discover a world of knowledge and get your questions answered at IDNLearn.com. Our platform is designed to provide trustworthy and thorough answers to any questions you may have.

Create a class named TestCircle whose main() method declares Several Circle objects. Using the setRadius() method, assign one Circle a small radius value, and assign another a larger value. Do not assign a value to the radius of the third circle; instead, retain the value assigned at construction. Display all the values for all the Circle objects. Save the application as TestCircle.java

Sagot :

Answer:ublic class Circle {

public int radius = 1;

public double diameter;

public double area;

//Constructor for circle class

public double Circle(int First){

return radius;

}

//Start set and get for radius

private double setRadius(int r){

   return radius = 5;

}

private double getRadius(){

 return radius;

}

//Start set and get for diameter

public double setDiamter(double d){

   return diameter = 7;

}

public double getDiamter(){

 return radius * diameter;

}