Answer Posted / sujith
The above answer is well explained. In technical terms it
can be explained as same function name with different
signature. Signature means only interms of arguments, and
not for return types. The idea is very simple and is a
feature which make the end user comfortable, and as Swetcha
said, it is finally the compiler will decide, which function
to call when, according to the type of data passed to the
function.
eg. int add(int, int)
double add(double, double)
char add(char, char)
but the following is not possible
int add(int, int)
char add(int, int)
Is This Answer Correct ? | 0 Yes | 7 No |
Post New Answer View All Answers
Why is oop useful?
What is pointer in oop?
Why it is called runtime polymorphism?
class CTest { public: void someMethod() { int nCount = 0; cout << "This is some method --> " << nCount; } }; int main() { CTest *pctest; pctest->someMethod(); return 0; } It will executes the someMethod() and displays the value too. how is it possible with our creating memory for the class . i think iam not creating object for the class. Thanks in Advance... Prakash
What are the 4 main oop principles?
Can destructor be overloaded?
Do you know about multiple inheritance?
write a program that takes input in digits and display the result in words from 1 to 1000
What is constructor overloading in oop?
What is overloading in oops?
What is encapsulation c#?
Why is polymorphism needed?
c++ program to swap the objects of two different classes
what is the sylabus for priliminaries?
Can we create object of abstract class?