Ok. To illustrate the use of an abstract class, we will start from an Animal class (openclassrooms.com/fr/courses/2683... abstract-classes-and-interfaces-# / id / r-2181451).
An abstract class designates a concept in its simplest form. So an Animal has a weight and a color of fur. Generally, an Animal Eats, Cries, Drinks and Moves. Each of these methods has no body because the abstract class is used to define the actions that these Animals have IN COMMON.
What is the dog's cry? He barks.
Cat ? He meows.
Lion ? He roars.
....
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
1/2
Ok. To illustrate the use of an abstract class, we will start from an Animal class (openclassrooms.com/fr/courses/2683... abstract-classes-and-interfaces-# / id / r-2181451).
An abstract class designates a concept in its simplest form. So an Animal has a weight and a color of fur. Generally, an Animal Eats, Cries, Drinks and Moves. Each of these methods has no body because the abstract class is used to define the actions that these Animals have IN COMMON.
What is the dog's cry? He barks.
Cat ? He meows.
Lion ? He roars.
....