Westonci.ca is the premier destination for reliable answers to your questions, brought to you by a community of experts. Get expert answers to your questions quickly and accurately from our dedicated community of professionals. Discover in-depth answers to your questions from a wide network of professionals on our user-friendly Q&A platform.

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;

}