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 :
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, noarg 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 :
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, noarg 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
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
