MCQ Practice Single Best Answer Topic: Module 13: Classes

Q What is the command used to call the method named myMethod in the parent class from the child class?

Class myChildClass extends myParentBaseClass
{
Public void myMethod()
   {
_____________();
~~~Body of new code here~~~
   }
}

Question ID
#9379
Subchapter
Module 13: Classes
Action
Choose one option below

Choose Your Answer

Click an option to check whether your answer is correct.

  • A insert
  • B return
  • C void
  • D super
Correct Answer: D

Explanation

Justification:

  1. Insert is not a keyword, but a method on tables. It is not used to call an override method, but to insert data into a table .
  2. Return is not a valid keyword used in inheritance scenarios.
  3. The void keyword is used before a method. This indicates that a given method does not return a value. The void keyword is already used before myMethod().
  4. Super() is the correct call to ensure that the method of the same name, “myMethod” is called.

 

Related Lesson: Class Inheritance

Share This Question

Share this MCQ with your friends or study group.