Answer to Question #3135 in C# for Kevin
The abstract classes are used in order to define some behavior of the specific kind of the instances. The classic example of using the Abstract classes and Virtual Functions is the abstract class Shape and derived classes Circle, Triangle, Square etc.
Class Shape defines function "int FindArea()" for example, this function is virtual and is implemented in the derived classes. Every specific class has the specific implementation of this method. The advantage of this type of design is that we can create the
collection of the Shape references and then add to this collection the objects of the derived classes. When we call the function FindArea(), it executes for the correct type of the object.
Need a fast expert's response?Submit order
and get a quick answer at the best price
for any assignment or question with DETAILED EXPLANATIONS!