What is polymorphism? Explain with an example.

Answer Posted / prabhati

polymorphism allows the usage of same operators or functions
in different ways. eg: 7+3 is used for addition
"poly"+"morphism" is used for
concatenating these two words

types of polymorphism:
virtual functions
operator overloading
function overloading

Is This Answer Correct ?    10 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can a varargs method be overloaded?

618


What is difference between inheritance and polymorphism?

574


What is encapsulation with example?

582


What is multilevel inheritance explain with example?

630


What are main features of oop?

637






write knight tour problem which is present in datastructure

2168


What is polymorphism programming?

607


Can we create object of interface?

610


What is polymorphism what are the different types of polymorphism?

566


What is abstract class in oops?

602


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!!!)

1643


How many human genes are polymorphic?

577


Question: Write a program that prints a paycheck. Ask the program user for the name of the employee, the hourly rate, and the number of hours worked. If the number of hours exceeds 40, the employee is paid “time and a half”, that is, 150 percent of the hourly rate on the hours exceeding 40. Be sure to use stepwi se refine ment and break your solution into several functions. Use the int_name function to print the dollar amount of the check.

701


What is oops and why we use oops?

573


If a=5, b=6, c=7, b+=a%c*2. What is the final value of b?

944