Question: Problem 1 : Complete a properly encapsulated class named Shape, which has the following: A boolean instance variable named isFilled. A String instance variable named

Problem 1:
Complete a properly encapsulated class named Shape, which has the following:
A boolean instance variable named isFilled.
A String instance variable named color.
A default, no-arg constructor which sets isFilled to true, and color to
"Green".
An overloaded constructor which takes two parameters, a boolean and a
String and sets the instance variables accordingly.
An overridden toString() method, which returns a String. The String
should contain: The values of the instance variables in the following format:
Filled: true
Color: GreenProblem 1:
Complete a properly encapsulated class named Shape, which has the following:
A boolean instance variable named isFilled.
A String instance variable named color.
A default, no-arg constructor which sets isFilled to true, and color to
"Green".
An overloaded constructor which takes two parameters, a boolean and a
String and sets the instance variables accordingly.
An overridden toString() method, which returns a String. The String
should contain: The values of the instance variables in the following format:
Filled: true
Color: Green
Problem 1 : Complete a properly encapsulated

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!