MCQ Single Best Answer Moderate

Q
[Inheritance]

In single inheritance, which one of the following keywords should NOT be used?

ID: #24949 Competency focused Practice Questions ISC Class XII Computer Science 4 views
Question Info
#24949Q ID
ModerateDifficulty
Competency focused Practice Questions ISC Class XII Computer ScienceTopic

Choose the Best Option

Click any option to instantly check if you're correct.

  • A extends
  • B this
  • C super
  • D implements
Correct Answer: Option D

Explanation

[Inheritance]

In single inheritance, which one of the following keywords should NOT be used?
(a) extends
(b) this
(c) super
(d) implements
Correct Answer: (d) implements

Understanding Single Inheritance:

Single inheritance means one class inherits from another class.

class Parent { } class Child extends Parent { }

Keyword Analysis:

  • extends
    Used for inheritance between classes.
    Example:
    class Child extends Parent
  • this
    Refers to the current object. It can be used inside inherited classes.
  • super
    Used to refer to parent class members. Important in inheritance.
    Example:
    super.method();
  • implements
    Used for implementing interfaces, not for class inheritance.
    Example:
    class Test implements Runnable

Important Concept:

Class Inheritance → uses extends Interface Implementation → uses implements

Conclusion:

Since implements is not used for class inheritance, it should NOT be used in single inheritance.

Correct Answer: (d) implements

Share This Question

Challenge a friend or share with your study group.