Monday 15 October 2012

Career Mania 55: FaaDoOEngineers.com: Polymorphism & Virtual Functions Tutorial (17 Pages)

Career Mania 55
Career news.....www.careermania55.koolcentre.in,movies news.....www.koolcentre.in
FaaDoOEngineers.com: Polymorphism & Virtual Functions Tutorial (17 Pages)
Oct 16th 2012, 06:27

FaaDoOEngineers.com
India's BIGGEST Website for Engineers & Aspiring Engineers!
Polymorphism & Virtual Functions Tutorial (17 Pages)
Oct 16th 2012, 05:07

Polymorphism is defined as one interface to control access to a general class of actions. There are two types of polymorphism one is compile time polymorphism and the other is run time polymorphism. Compile time polymorphism is functions and operators overloading. Runtime time polymorphism is done using inheritance and virtual functions. Function Overloading Polymorphism means that functions assume different forms at different times. In case of compile time it is called function overloading. For example, a program can consist of two functions where one can perform integer addition and other can perform addition of floating point numbers but the name of the functions can be same such as add. The function add() is said to be overloaded. Two or more functions can have same name but their parameter list should be different either in terms of parameters or their data types. The functions which differ only in their return types cannot be overloaded. The compiler will select the right function depending on the type of parameters passed. In cases of classes constructors could be overloaded as there can be both initialized and unintialized objects. Here is a program which illustrates the working of compile time function overloading and constructor overloading.

You are receiving this email because you subscribed to this feed at blogtrottr.com. If you no longer wish to receive these emails, you can unsubscribe from this feed, or manage all your subscriptions

You are receiving this email because you subscribed to this feed at blogtrottr.com.

If you no longer wish to receive these emails, you can unsubscribe from this feed, or manage all your subscriptions

No comments:

Post a Comment