‹ Back to the paper
In Java, a subclass can override a method of its superclass by defining a method with the same name…
Assertion: In Java, a subclass can override a method of its superclass by defining a method with the same name and same signature.
Reason: If the subclass calls the overridden method without using the super keyword, the subclass’s own version of the method will get called, leading to recursion.
Given below are two statements marked, Assertion and Reason. Read the two statements carefully and choose the correct option.
- (a)Both Assertion and Reason are true and Reason is the correct explanation for Assertion.
- (b)Both Assertion and Reason are true but Reason is not the correct explanation for Assertion.
- (c)Assertion is true and Reason is false.
- (d)Both Assertion and Reason are false.
Answer
Answer
AICorrect option: (b)
Answer: (b) Both Assertion and Reason are true but Reason is not the correct explanation for Assertion.
Assertion: In Java, a subclass overrides a superclass method by defining a method with the same name and same signature — this is the correct definition of method overriding, so it is true.
Reason: If a subclass method calls the overridden method by its own name (without 'super'), dynamic method dispatch causes the subclass's own version to be invoked again — which can lead to (self-)recursion. This is also a true statement, but it describes a runtime consequence of overriding rather than explaining the rule/definition of overriding stated in the Assertion. Hence Reason does not explain Assertion.
From ISC 2026 Improvement Computer Science Paper 1, question 1(vi).