Multiple Inheritance is one type of inheritance in object oriented programming, In this program we are going to inherit two base classes in derived class, the purpose of multiple inheritance is we need two seperate classes with different properties to be included in one derived class.
Home
Archive for
2014
Function Overloading (Polymorphism) Code IN C++ to Calculate Area
Simple Program to apply concept of Function overloading we are using two functions named area with different parameters each. To calculate area of circle we need only 1 parameter i.e radius and to calculate area of rectangle we need two parameters length and breadth.
Virtual Function Polymorphism Implementation In C++ Program
Here we are calculate area of cicle and rectangle using Virtual Functions, it is one of the form of polymorphism, in class shape we are declaring the function area and in class circle and rectangle we are inheriting function from base class shape however polymorphism comes into play when the functions perform different operations, in respective classes.
Subscribe to:
Posts
(
Atom
)