Question 19Asked in UGC NET Computer Science, June 2016 (Paper II & III, Selected Questions)

When a method in a subclass has the same name and type signatures as a method in the superclass, then the method in the subclass ________ the method in the…

When a method in a subclass has the same name and type signatures as a method in the superclass, then the method in the subclass ________ the method in the superclass.
  1. AOverloads
  2. BFriendships
  3. CInherits
  4. DOver rides
Show answerHide answer

Correct answer: (D) Over rides

Explanation

In a class hierarchy, when a method in a subclass has the name and type signatures as a method in its superclass, then the method in the subclass is said to over ride the method in the superclass.

From UGC NET Computer Science PYQ, June 2016 (Paper II & III, Selected Questions)

This is question 19 of UGC NET Computer Science PYQ, June 2016 (Paper II & III, Selected Questions). See all questions of this paper with answers, or attempt the paper as a timed online test to get your score and all-India rank.