click below
click below
Normal Size Small Size show me how
Inheritance & Compos
Inheritance & Composition
| Question | Answer |
|---|---|
| Inheritance is an ___________ relation. | "is-a" |
| Composition (aggregation) is a ___________ relation. | "has-a" |
| In a single inheritance, the derived class is derived from only ___________ existing class called the base class. | one |
| In a multiple inheritance, a derived class is derived from ___________ base class. | more than one |
| The private members of a base class are ___________ to the base class. The derived class cannot directly access them. | private |
| The public members of a base class can be inherited either as ___________ or ___________ by the derived class. | public private |
| A derived class can ___________ the member functions of a base class, but this redefinition applies only to the objects of the derived class. | redefine |
| If in heading of def of a derived class’s constructor, no call to a constructor (w/ parameters) of a base class is specified, then during the derived class’s object declaration & initialization, the default constructor (if any) of the ___ class executes | base |
| When initializing the object of a derived class, the constructor of the ___________ class is executed first. | base |
| In composition (aggregation), a member of a class is an object of ___________ class. | another |
| The three basic principles of OOD are ___________, ___________, and ___________. | encapsulation, inheritance, polymorphism |