Inheritance [ class – abstract class (extends) ]

First let’s understand what is an abstract class is. So, an abstract class is like a house that haven’t been fully developed yet, so the house can have some completed parts and also can have incomplete parts. As same as this the abstract class can have concrete methods as well as abstract methods which doesn’t have method body. When creating an abstract method there are few things that we need to consider: If any class contains any abstract method, that class needs to be marked as abstract using abstract keyword. abstract methods cannot contain static keyword. In other words, static & abstract keyword cannot be in the same method. There are two ways that an abstract class can be extended by a child class: a. extend to a concrete class: when extend happens between concrete class and an abstract class the abstract methods available within the abstract class needs to be override. It is a must. Th...