In: Computer Science
Shirt inherits clothing. In the Shirt constructor, how is the Clothing default constructor called? (Select all that apply)
Group of answer choices
super();
Clothing();
Clothing.Clothing()
Make no explicit call
Shirt inherits Clothing. In the Shirt constructor, how is a Clothing constructor with one int parameter called?
For the answer, assume that an int variable called "myInt" is in scope.
Group of answer choices
Clothing.Clothing(myInt);
Clothing(myInt);
super(myInt);
Make no explicit call
Shirt inherits Clothing. Both classes have their own version of the method fold(). Which fold() is executed in the following code?
Shirt myShirt = new Shirt();
myShirt.fold();
Group of answer choices
The Clothing version
The Shirt version
Both, Shirt and then Clothing
Both, Clothing and then Shirt
Question:
Shirt inherits clothing. In the Shirt constructor, how is the
Clothing default constructor called? (Select all that apply)
Ans:
super();
Question:
Shirt inherits Clothing. In the Shirt constructor, how is a
Clothing constructor with one int parameter called?
For the answer, assume that an int variable called "myInt" is in
scope.
Ans:
super(myInt);
Question:
Shirt inherits Clothing. Both classes have their own version of the
method fold(). Which fold() is executed in the following
code?
Shirt myShirt = new Shirt();
myShirt.fold();
Ans: The Clothing
version
(Feel free to drop me a comment, If you need any help)
Hope this Helps!!!
Please upvote as well, If you got the answer?
If not please comment, I will Help you with that...