Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Java by (6.5k points)
What if we extend a normal class which has an abstract method, wouldn't it act as simple inheritance?

1 Answer

0 votes
by (11.3k points)

There are two rules to abstract methods and abstract classes:

  1. Even if there is one abstract method in a class, the class has to be defined as an abstract class.
  2. All abstract methods have to be implemented in the class that extends the abstract class. 

No, it will not act as simple inheritance because the point of abstract classes is providing a template set of methods to the classes that will implement them, but they aren't defined as in normal parent classes.  Simple inheritance would work if there is something set in the parent method to override, not when it is empty. 

Related questions

0 votes
1 answer
asked Jul 14, 2019 in Java by Suresh (3.4k points)
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

Browse Categories

...