Posts

Showing posts from July, 2011

Something abt PoLymOrphISM

A most prominent interview question regd OOPs I: What is Polymorphism? S: (Ha ha ;D) Polymorphism is of two types runtime and compile time. Methods of Compile time polymorphism are Function Overloading and Operator Overloading Methods of Runtime polymorphism are virtual functions I: Kool....What is virtual functions or Method Over riding? S: (Super :D :D)It is possible that we can assign reference of a derived class object to base class In Such a case if derived class implements a function with same signature as its base then an ambiguity will be arised on resolving function call So, inorder to overcome that we use virtual functions. I: Good... Why are they refered as runtime polymorphism? What do u mean by runtime?? S: (Pochu da :( :( ) "Actually" the resolution of function call takes place at runtime. "That is" Compiler don't know which function to call ... Blah Blah .... I: Why should the resolution take place at runtime? Why not at com...