what is the difference between containership and inheritence?



what is the difference between containership and inheritence?..

Answer / 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

More OOPS Interview Questions

Why do we use virtual functions?

4 Answers  


Why is there no multiple inheritance?

1 Answers  


Why do we use oops?

1 Answers  


How compiler selects(internally) required overridden function in inheritance?

2 Answers   CSC, Infinite Computer Solutions,


Describe the difference between a Thread and a Process?

11 Answers   Siebel Systems,


What is protected in oop?

1 Answers  


What is difference between inheritance and polymorphism?

1 Answers  


if i have same function with same number of argument but defined in different files. Now i am adding these two files in a third file and calling this function . which will get called and wht decide the precedence?

2 Answers  


Where is pseudocode used?

1 Answers  


There are 2 classes defined as below public class A { class B b; } public class B { class A a; } compiler gives error. How to fix it?

3 Answers   Microsoft,


State what is encapsulation and friend function?

1 Answers   BirlaSoft,


what is polymorpsim? what are its types?

8 Answers  


Categories