What is polymorphism ? Explain with examples

Answer Posted / k.r.sukumar

Polymorphism means "A single function which is used for
different purposes depending upon the parameters passed"

for eg;
Area is the function name which is used for
calculating areas of the rectangle, triangle and even more.
from this persepective we conclude that area is the single
function which is used for calculating different ones.
area(a);---> Area of the square

area(l,b);---> Area of the rectangle.

Is This Answer Correct ?    22 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What does no cap mean?

590


They started with the brief introduction followed by few basic C++ questions on polumorphism, inheritance and then virtual functions. What is polymorphims? How you will access polymorphic functions in C? How virtual function mechanism works?

1393


Which type does string inherit from?

614


What does and I oop and sksksk mean?

650


What are the important components of cohesion?

550






Write a C++ program without using any loop (if, for, while etc) to print prime numbers from 1 to 100 and 100 to 1 (Do not use 200 print statements!!!)

1637


What is the main purpose of inheritance law?

667


Give an example where we have to specifically use C programming language and C++ programming language cannot be used?

1147


What exactly is polymorphism?

604


What is abstraction in oops with example?

772


Explain the advantages of inheritance.

672


when to use 'mutable' keyword and when to use 'const cast' in c++

1642


write knight tour problem which is present in datastructure

2164


Why is polymorphism important in oop?

629


what's the basic's in dot net

1736