Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

So there are 3 circle constructors. What does a constructor of overloaded one(th

ID: 3773464 • Letter: S

Question

So there are 3 circle constructors.

What does a constructor of overloaded one(the one that has 3 parameters) does? and what does a empty parametor one does?
I am confused which one does what.

LISTING 11.2 CircleFromSimpleGeometricobject.java 1 public class CircleFromsimpleGeometricobject extends SimpleGeometricobject f private double radius; 3 4 5 public CircleFromSimpleGeometricobject) 8 public CircleFromSimpleGeometricobject (double radius) ( this.radius - radius; 10 2 public CircleFromSimpleGeometricobject double radius, 13 14 15 16 String color, boolean filled) this.radius-radius; setColor(color); setFilled(filled)

Explanation / Answer

What does a constructor of overloaded one(the one that has 3 parameters) does? and what does a empty parametor one does?

1. Constructor overloaded with 3 parameters:

This function takes a total of 3 parameters: double radius, String color, boolean filled.

The variable radius is assigned to the class private variable, radius.

The variable color is set to the variable color, using the mutator setColor() of the parent class SimpleGeometricObject.

The variable filled is set to the variable filled, using the mutator setFilled() of the parent class again.

The default constructor will set the radius to 0.0, color to white, and filled to false.

If you need any further clarifications, just get back to me.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote