What is Compile time polymorphism and Runtime polymorphism?
What is Compile time polymorphism and Runtime polymorphism?
the overloaded methods can be called compile time.... inheritance and virtual functions can be called as runtime polymorphism.
Guys please start a discussion on this.
Does any one have an idea on the various categories and varieties of polymorphism ?
Using method overloading u can acheive the compile time polymorphism. It means Compiler knows at the compile time which object assigned to which class.
Using method overridding u can acheive the run time polymorphism. It means Compiler didn't know the compile time and it knows only at the run time.
In our forum we already discuss about this one...If you want more details go through the following URL...
Polymorphism
----------------------
suresh
Polymorphism refers to the similarity among several functions by the same name.However, the compiler makes the distinction among them either at the compile time (before the program is run) or at the run time(program has become a process). At compile time the distinction is made with the types and number of parameters the same name function has, as such its also called early binding. The Run time Polymorphism(binding) is done for the functions which are virtual,where the distinction can't be made on the basis of types or nume of functions and the base class pointer can refer to the derived class functions(same name).This is done with the help of Virtual Table.