6.0k views
2 votes
What is true about using the reserved word super?

It can only be used in a class that contains an extends clause

It can only be used in a constructor

It can only be used in subclasses

It can only be used in superclasses

User WhiteRau
by
6.6k points

1 Answer

4 votes

Answer:

It can only be used in superclasses

Step-by-step explanation:

In computer language, a reserved word is a word that cannot be used as an identifier, such as the name of a variable, function, or label, it is "reserved from use".

If your method overrides one of its superclass's methods, you can invoke the overridden method through the use of the keyword super, it can also be used to refer to a hidden field.

We can conclude that the correct answer is "It can only be used in superclasses" because, in a subclass’ constructor, we can call the superclass’ constructor with the keyword super instead of the superclass’ (constructor’s) name.

I hope you find this information useful and interesting! Good luck!

User BigDataKid
by
5.7k points