Chapter 11


1.

What is inheritance?

it is the process whereby one class gets, or inherits, all the public andprotected members of another class.

2.

How do you call an overloaded constructor in the base class?

the derived classes constructor is declared to call a specific base class constructor.

3.

What is another word for base class?

parent class

4.

How would you declare class a so that it inherits from class b?

 class derived::public class b

5.

What is another term for derived class?

child class

6.

What is a protected variable?

a variable that is private, but can be inherited

7.

What is another word for a function that is part of a class?

method

8.

Are private members inherited?

no

9.

When you have a derived class, which constructor is executed first…the derived class constructor or the base class constructor?

the base class

10.

When one class contains another class, what type of relationship is there?

this is a has-a relationship

Answers

1.

It is the process whereby one class gets, or inherits, all the public and protected members of another class.

2.

The derived classes constructor is declared to call a specific base class constructor.

3.

Parent class

4.

class derived::public class b

5.

Child class

6.

A variable that is private, but can be inherited

7.

method

8.

No

9.

The base class

10.

This is a has-a relationship




C++ Programming Fundamentals
C++ Programming Fundamentals (Cyberrookies)
ISBN: 1584502371
EAN: 2147483647
Year: 2005
Pages: 197
Authors: Chuck Easttom

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net