Answer Posted / anshu sharma
Hierarchy is used to define more specialized classes based
on a preexisting generalized
class.Example we have VEHICLE class and we can inherit this
class make more specialized
class like CAR, which will add new attributes and use some
existing qualities of the
parent class.Its shows more of a parent-child relationship
.This kind of hierarchy is called
inheritance
| Is This Answer Correct ? | 1 Yes | 1 No |
Post New Answer View All Answers
What is polymorphism used for?
Give an example where we have to specifically use C programming language and C++ programming language cannot be used?
write a programe to calculate the simple intrest and compund intrest using by function overlading
Why it is called runtime polymorphism?
What is the real time example of inheritance?
There are two base class B1,B2 and there is one class D which is derived from both classes, Explain the flow of calling constructors and destructors when an object of derived class is instantiated.
Can destructor be overloaded?
Why we use classes in oop?
What is abstraction in oops with example?
What is an interface in oop?
How long to learn object oriented programming?
What is difference between polymorphism 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.
Why is there no multiple inheritance?
What is interface in oop?