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


Please Help Members By Posting Answers For Below Questions

What is object in oops?

614


What is constructor overloading in oop?

607


What is oops in simple words?

581


What is destructor give example?

603


What are the three main types of variables?

600






What is interface? When and where is it used?

1664


What are the benefits of oop?

607


Why multiple inheritance is not allowed?

584


What is inheritance in simple words?

626


#include #include #include #include void insert(char *items, int count); int main(void) { char s[255]; printf("Enter a string:"); gets(s); insert(s, strlen(s)); printf("The sorted string is: %s.\n", s); getch(); return 0; } void insert(char *items, int count) { register int a, b; char t; for(a=1; a < count; ++a) { t = items[a]; for(b=a-1; (b >= 0) && (t < items[b]); b--) items[b+1] = items[b]; items[b+1] = t; } } design an algorithm for Insertion Sort

2168


What is the example of polymorphism?

558


Why is static class not inherited?

599


What is polymorphism and types?

602


What is the diamond problem in inheritance?

579


What is the renewal class?

2167