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

Whats oop mean?

598


Which is not an object oriented programming language?

544


What is the difference between encapsulation and polymorphism?

598


Is enum a class?

607


Write a program to compute for numeric grades for a course. The course records are in a file that will serve as the input file. The input file is in exactly the following format: Each line contains a student's first name, then one space, then ten quiz scores all on one line. The quiz scores are in whole number and are separated by one space. Your program will take it input from this file and sends it output to a second file. The data in the output file will be exactly the same as the data in the input file except that there will be one additional number (of type double) at the end of each line. This number will be the average of the student's ten quiz scores. Use at least one function that has file streams as all or some of its arguments.

2578






Give two or more real cenario of virtual function and vertual object

1855


What is the difference between a mixin and inheritance?

524


hi, this is raju,iam studying b.tech 2nd year,iam want know about group1 and group2 details, and we can studying without going to any instutions? please help me.

1543


i=20;k=0; for(j=1;k-i;k+=j<10?4:3) { cout<

1419


What is static in oop?

591


What is the diamond problem in inheritance?

579


What is constructor overloading in oop?

607


What is encapsulation with real life example?

572


What is class encapsulation?

598


How does polymorphism work?

635