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
Give an example where we have to specifically use C programming language and C++ programming language cannot be used?
They started with the brief introduction followed by few basic C++ questions on polumorphism, inheritance and then virtual functions. What is polymorphims? How you will access polymorphic functions in C? How virtual function mechanism works?
Who invented oop?
Whats is abstraction in oops?
What is the real time example of encapsulation?
is there any choice in opting subjects like 4 out of 7
What is interface? When and where is it used?
What is object in oop?
What are main features of oop?
Can static class have constructor?
Why do we use oops?
What is the point of oop?
What is polymorphism and example?
What is an interface in oop?
What is encapsulation oop?