What is polymorphism ? Explain with examples
Answer Posted / nisha
Polymorphism means one name,many properties.Example of
polymorphism is function overloading whare we can have many
functions with same name but having different properties
like the number of arguments in the function header.
| Is This Answer Correct ? | 43 Yes | 8 No |
Post New Answer View All Answers
Why do we need oop?
What does it mean when someone says I oop?
what is different between oops and c++
Why is destructor used?
class CTest { public: void someMethod() { int nCount = 0; cout << "This is some method --> " << nCount; } }; int main() { CTest *pctest; pctest->someMethod(); return 0; } It will executes the someMethod() and displays the value too. how is it possible with our creating memory for the class . i think iam not creating object for the class. Thanks in Advance... Prakash
Is oop better than procedural?
What is the difference between a mixin and inheritance?
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.
write a C++ program for booking using constructor and destructor.
What is polymorphism what is it for and how is it used?
How is class defined?
What is inheritance in oop?
Explain virtual inheritance?
Why is there no multiple inheritance?
What is multilevel inheritance explain with example?