1.

What do you understand by Function overloading or Functional polymorphism? Explain with suitable example.

Answer»

It is a method of using the same function or method to work using different sets of input. Function overloading is one of the example of polymorphism, where more than one function carrying same name behave differently with different set of parameters passed to them.

void show()

{

cout<<”\n Hello World!”;

}

void show(char na[])

{

cout<<”\n Hello World! Its ”<<na;

}



Discussion

No Comment Found

Related InterviewSolutions