187k views
3 votes
A subclass can explicitly invoke a constructor of its superclass by using the superclass constructor call syntax—keyword ____ followed by a set of parentheses containing the superclass constructor’s arguments.

1 Answer

4 votes

Answer:

"new" keyword is used

Step-by-step explanation:

let assume there is a super class called Animal and the constructor takes a boolean value called isMammal, and we have a subclass called Goat which inherits from the animal class. To invoke the constructor of animal is

Animal myAnimal = new Animal(true);

the new keyword was used to invoke from super class, passing true as argument because a goat is a mammal.

User Nerdybeardo
by
7.2k points