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 |
difference between abstraction and encapsulation with progarammatic eg. hi,just recently i went for an interview .The interviewer asked what is the difference between abstraction and encapsulation with programmatic eg. I gave the answer as encapsulation mean hiding the relevant data which is not useful for the user, eg a electric fan .hiding the information how the electricity is converted into machanical energy. abtraction showing only the relevant data to the user eg electric fan. it look ,its color ,it design etc only relevant data. Then the interviewer asked me, give me some programmic eg .I Said Let assume a web form having control like textbox,button etc. The user can view textbox,button etc this is the eg of abstraction and when the user click on the button how he is redirected is not known by the user is the eg of the encapsulation. Am I Correct .was the answer given by me is perfect .now i am planing to go for an another interview should i give the same answer.IF not please suggest me a better answer.with some good eg Please help
write a program to find 2 power of a 5digit number with out using big int and exponent ?
write a code for this:trailer recordId contains a value other than 99, then the file must error with the reason ‘Invalid RECORD_ID’(User Defined Exception).
Generally, in all C++ programs, texts are in white colour. Can we change the colour of the text(either input or output or both)? If so, help me out.
What is destructor give example?
What is design patterns in C++?
difference between structure and union.
What is the difference between abstraction and polymorphism?
Write an operator overloading program to write S3+=S2.
Can anyone please explain runtime polymorphism with a real time example??at what ciscumstances we go for it??
what is data hiding.
What is object and example?