MCQ Practice Single Best Answer Topic: Abstract class and method

Q What is the purpose of the "super" keyword in Java?

Question ID
#10344
Subchapter
Abstract class and method
Action
Choose one option below

Choose Your Answer

Click an option to check whether your answer is correct.

  • A The "super" keyword is used to refer to the immediate subclass of a class.
  • B The "super" keyword is used to invoke the superclass constructor or method.
  • C The "super" keyword is used to specify a superclass in a multiple inheritance scenario.
  • D The "super" keyword is used to define static variables in a class.
Correct Answer: B

Explanation

The "super" keyword is used to invoke the superclass constructor or method in Java. It is used to access the members of the superclass that have been hidden by a subclass. It is also used to refer to the immediate superclass of a class.

Share This Question

Share this MCQ with your friends or study group.