A class that is designed to provide common state and behavior for it's child classes.
It is not designed to have instances of itself (this type of class cannot be directly instantiated)The children class can be instantiated.
An example of a class hierarchy where an abstract class would be useful:Office Furniture, children classes would include chair, desk and filing cabinet.
A parent class contains all general state & behaviour & sometimes this is enough. However, if there is no practical use for the parent (based on requirements), this parent should be declared as abstract so that it can never be instantiated.
ReplyDeleteGood example, just rethink the difference between a parent class that is concrete & a parent class that is abstract :)