What are the different forms of polymorphism??

Answer Posted / mms zubeir

Though there are many answers which are all true to some
extent, I would like to conclude all these into two broad
categories:

1. Ad-hoc polymorphism
2. Parametric polymorphism

As the meaning of the names themselves suggests their usage.

If the range of actual types that can be used is finite
and the combinations must be specified individually prior
to use, it is called Ad-hoc polymorphism.

If all code is written without mention of any specific type
and thus can be used transparently with any number of new
types, it is called parametric polymorphism.

Is This Answer Correct ?    5 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

write a code for this:trailer recordId contains a value other than 99, then the file must error with the reason ‘Invalid RECORD_ID’(User Defined Exception).

1919


Why is polymorphism used?

788


Why do we need oop?

885


Whats is abstraction in oops?

844


Describe these concepts: Polymorphism, Inheritance and Abstraction.

887


What type of loop is a for loop?

873


What is overriding vs overloading?

803


Question: Implement a base class Appointment and derived classes Onetime, Daily, Weekly, and Monthly. An appointment has a description (for example, “see the dentist”) and a date and time. Write a virtual function occurs_on(int year, int month, int day) that checks whether the appointment occurs on that date. For example, for a monthly appointment, you must check whether the day of the month matches. Then fill a vector of Appointment* with a mixture of appointments. Have the user enter a date and print out all appointments that happen on that date.

938


What are oops functions?

793


What is class and object in oops?

849


Can we override main method?

849


What are the benefits of interface?

812


What is new keyword in oops?

802


What is the use of oops?

811


i am getting an of the type can not convert int to int *. to overcome this problem what we should do?

2072