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 are the ways in which a constructors can be called?
What is polymorphism what is it for and how is it used?
How do you explain polymorphism?
How to handle exception in c++, For example in a functions i am assigning memory to some variables and also in next instructions in am dividing one variable also. If this functions generates a error while allocating memory to those variable and also while dividing the variable if i divide by zero then catch block how it will identify that this error has cone from perticular instruction
What is object in oops?
What is object in oop?
Will I be able to get a picture in D drive to the c++ program? If so, help me out?
What is the point of oop?
Give an example where we have to specifically use C programming language and C++ programming language cannot be used?
Why is static class not inherited?
Why is abstraction needed?
What does and I oop and sksksk mean?
Why do we use class in oops?
What does <> mean pseudocode?
What is the benefit of oop?