Question:

Why sub class methods need to override super class abstract methods?

by  |  earlier

0 LIKES UnLike

Why sub class methods need to override super class abstract methods?

 Tags:

   Report

1 ANSWERS


  1. An abstract method means that it must be overridden. All abstract methods must be overridden for java to allow you to compile them. The reasoning is that if you have, for example, a method f() in the class a which calls an abstract method getnum() in that same class, and a class b which extends a, if you called b.f() then it would call getnum which has no actual content. For this reason, getnum is declared as abstract and must be overridden in b so that f() has something to call.

Question Stats

Latest activity: earlier.
This question has 1 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.
Unanswered Questions