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 |
What's the full form of STL?
c++ provides classes...and classes do what we want but why then strcut are used...if we say data hiding... it is also provided by c++ in structs then why to prefer clasess
Which method cannot be overridden?
What is polymorphism? Explain with an example.
what is the difference between a package and a software?
What is differance between Abstract and Interface
why we are declare the function in the abstract class even though we are declaring it in Derived class?
Name a typical usage of polymorphism
Can we call a base class method without creating instance?
WRITE A SIMPLE C++ PROGRAM TO SWAP TWO NOS WITHOUT USING TEMP
Can we have a private constructor ?
12 Answers HSBC, Ness Technologies, TCS, Wipro,
What is the difference between class and structure?