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 multilevel inheritance in oop?

0 Answers  


What is the difference between Home and $Home?

2 Answers   TCS,


why c++ is called OOPS? waht is inherutance? what is compiler?

5 Answers  


what is virtual destructor

7 Answers   L&T, TCS,


What are oops methods?

0 Answers  






What is pure oop?

0 Answers  


if u write a class do u write Assignment operator and copy constructor

1 Answers   Siemens,


What are the OOPS concepts?

106 Answers   A1 Technology, Bajaj, CTS, EDS, HP, Infosys, Intel, Microsoft, MNC, Persistent, PlanetSoft, ProConstructor, TCS, Virtusa, Wipro, YSoft Solutions,


What is the types of inheritance?

0 Answers  


Program to read a comment string

1 Answers   IBM,


what type of questions

0 Answers   IBM,


#include <iostream> using namespace std; struct wow { int x; }; int main() { wow a; a.x = 22; int c = a.x; int *b = new int; cout << c; return 0; } option: No output 0 22 -(11) Will not compile

1 Answers   CTS, Wipro,


Categories