what is the difference between containership and inheritence?
Answer Posted / sandeep choudhary
inheritance is the ability for a class to inherit of
properties and the behavior from a parent class by extending it.
while containership is the ability of a class to contain the
another objects as member data.
if a class is extended, it inherits all the public and
protected properties and the behaviors and those behavior
may be overridden by the sub class.but if a class is
contained in another, container class does not have the
ability to add and modify of contained.
| Is This Answer Correct ? | 47 Yes | 2 No |
Post New Answer View All Answers
Write a program to implement OOPS concepts such as inheritance, polymorphism, friend function, operator overloading?
What is this pointer in oop?
What is the point of polymorphism?
INSTANCE FIELDS DECLARED private ARE ACCESSIBLE BY THE METHODS ONLY.CAN WE CHANGE THE private FIELD OF AN OBJECT IN A METHOD OF SOME OTHER OBJECT OF THE SAME CLASS?
Why is encapsulation used?
What is a class oop?
What are oops functions?
Why do we use class?
what is graphics
What is abstraction in oops with example?
What is polymorphism explain?
Can a varargs method be overloaded?
What is difference between inheritance and polymorphism?
What is data binding in oops?
Why interface is used?