There is something else about making a class and a method abstract. Why is it important? What is it "buying" us beyond virtual/override?
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.
1
Expert's answer
2011-06-15T11:04:21-0400
Unfortunately, your question requires a lot of work and cannot be done for free. Submit it with all requirements as an assignment to our control panel and we'll assist you.
Numbers and figures are an essential part of our world, necessary for almost everything we do every day. As important…
APPROVED BY CLIENTS
Finding a professional expert in "partial differential equations" in the advanced level is difficult.
You can find this expert in "Assignmentexpert.com" with confidence.
Exceptional experts! I appreciate your help. God bless you!
Comments
Leave a comment