What is polymorphism? Explain with an example.

Answer Posted / zahid hussain

polymorphism mean created a object which have many forms
method overloading and method overriding are these concept of polymorphism.

eg. a room have a electricity button which perform many functionality like on tube light, on bulb, on fan etc. one object button but perform many function..

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

State what is encapsulation and friend function?

703


• What are the desirable attributes for memory managment?

1732


What is the benefit of oop?

573


What is difference between multiple inheritance and multilevel inheritance?

606


Why do we use class?

638






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.

635


How to use CMutex, CSemaphore in VC++ MFC

4335


What is overloading and its types?

620


What is interface? When and where is it used?

1667


c++ program to swap the objects of two different classes

1767


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

1647


Is enum a class?

607


Can an interface inherit a class?

565


Templates mean

1592


What is overloading in oops?

598