08. Abstract vs Concrete methods in java

A class which is not abstract is referred as Concrete class. In the above example which I explained – Animal is a abstract class and Cat,Dog and Horse are concrete classes.

Key Points:

1.      An abstract class has no use until unless it is extended by some other class.

2.      If you declare an abstract method (discussed below) in a class then you must declare the class abstract as well. you can’t have abstract method in a non-abstract class. It’s vice versa is not always true: If a class is not having any abstract method then also it can be marked as abstract.

3.      Abstract class can have non-abstract method (concrete) as well.

1 comment: