Virtual function: Difference between revisions

Content deleted Content added
m Purpose: Fix code block formatting
Fix a grammatical error
Line 10:
The need of the virtual function or abstract method can be understood as follows:
 
A class is a user-defined data type. It is used to model an identified Entity in the problem ___domain. The information required of an entity becomes fields or data members of the class, The actions required of the entity becomes member functions or methods of the class. However, in some situationsituations, It is not possible to provide definition to one or more methods of the class. Let us understand the concept in the following scenario.
 
The identified Entity is Two-dimensional figure. It has two dimensions. Its area is required to be computed. Triangle, Rectangle, Square, Circle etc. are all two-dimensional figures. However the formula to compute area is different for each of the figures.