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

What is basic concept of oop?

0 Answers  


What is the difference between the c++ & java?

2 Answers  


What is data binding in oops?

0 Answers  


what is overloading

3 Answers   MindCracker,


What is Object and Class? What are the differences between them?

5 Answers  






In OverLoading concept,Why they are not consider return value and why they are consider only parameters in method? For ex: public int Add(int a,int b){...} public String Add(int a,int b){...}

1 Answers  


difference between class and object

10 Answers   Chandan, IBM, Magic Soft,


oops concept is used for?

3 Answers   Synergy,


What is virtual constructors/destructors?

4 Answers   IBS,


Conversion from a basic type to a class type may be achieved using______________

5 Answers   HCL,


when to use 'mutable' keyword and when to use 'const cast' in c++

0 Answers   TCS,


What is class and object with example?

0 Answers  


Categories