04-29-2011, 07:57 AM
What is polymorphism in c++ 2011
|
What is polymorphism in c++ 2011
|
|
04-29-2011, 07:57 AM
What is polymorphism in c++ 2011
04-29-2011, 07:58 AM
Polymorphism can be defined as “single interface multiple behaviour. Poly mean many morph means shapes, so one function taking many shapes. There are two types of polymorphism namely, runtime polymorphism and compile time polymorphism. Compile time polymorphism means functions overloading and run time polymorphism means virtual functions.
Example: Given a base class shape, polymorphism enables the programmer to define different area methods for nay number of derived classes, such as circles, rectangles and triangles. No matter what shape an object is, applying the area method to it will return the correct result. 0300-9520262 Get solution in 24 hour |cpmputer & internet mileys81:[SIZE="4"][SIZE="3"]....[/SIZE][/SIZE]
|
|
« Next Oldest | Next Newest »
|