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
What is this pointer in oop?
What is an interface in oop?
What are the three parts of a simple empty class?
Why do we use oop?
Why is polymorphism used?
What is oops and its features?
What are the two different types of polymorphism?
Give an example where we have to specifically use C programming language and C++ programming language cannot be used?
Why is object oriented programming so hard?
How to improve object oriented design skills?
What is a class and object?
What is class encapsulation?
What is polymorphism in oop example?
What is polymorphism used for?
Can we override main method?