Use LEFT and RIGHT arrow keys to navigate between flashcards;
Use UP and DOWN arrow keys to flip the card;
H to show hint;
A reads text to speech;
23 Cards in this Set
- Front
- Back
Member access specifiers (public and private) can appear: |
In any order and multiple times. |
|
Which of the following preprocessor directives does not constitute part of the preprocessor wrapper? |
#include. |
|
Member function definitions: |
Require the binary scope operator only when being defined outside of the definition of their class. |
|
Parameterized stream manipulator setfill specifies the fill character that is displayed when an output is displayed in a field wider than the number of characters or digits in the output. The effect of setfill applies: |
Until explicitly set to a different setting. |
|
Every object of the same class: |
Gets a copy of every member variable. |
|
Classes cannot: |
Initialize data members in the class definition. |
|
Variables defined inside a member function of a class have: |
Block scope. |
|
A class-scope variable hidden by a block-scope variable can be accessed by preceding the variable name with the class name followed by: |
::. |
|
When independent software vendors provide class libraries to clients, they typically give the __________ for the class’s interface and the __________ for the class’s implementation. |
Source code file, object module file. |
|
Which of the following is not true about separating a class’s interface and implementation? |
Changes in the class’s implementation will affect the client. |
|
The type of function a client would use to check the balance of his bank account would be: |
An access function. |
|
Utility functions: |
Are separate member functions that support operations of the class’s other member functions. |
|
A default constructor: |
Both (a) and (b). |
|
If a member function of a class already provides all or part of the functionality required by a constructor or another member function then: |
Call that member function from this constructor or member function. |
|
Which of the following is not true of a constructor and destructor of the same class? |
They both are able to have default arguments. |
|
Which of the following is not true of a destructor? |
It releases the object’s memory. |
|
Given the class definition: class CreateDestroy{public: CreateDestroy() { cout << "constructor called, "; } ~CreateDestroy() { cout << "destructor called, "; } };What will the following program output?int main(){ CreateDestroy c1; CreateDestroy c2; return 0;} |
constructor called, constructor called, destructor called, destructor called, . |
|
Given the class definition: class CreateDestroy{public: CreateDestroy() { cout << "constructor called, "; } ~CreateDestroy() { cout << "destructor called, "; } };What will the following program output? int main(){ for ( int i = 1; i <= 2; i++ ) CreateDestroy cd; return 0;} |
constructor called, destructor called, constructor called, destructor called, . |
|
Returning references to non-const, private data: |
Allows private member variables to be modified, thus “breaking encapsulation.” |
|
A client changing the values of private data members is: |
Possible using public functions and references. |
|
The assignment operator (=) can be used to: |
Copy data from one object to another |
|
Many ___________ exist which help to develop programs from portable, carefully tested and widely available components. |
Class libraries. |
|
Which of the following is not true about declaring references to objects of other classes inside a class definition? |
These references can be initialized inside the class definition. |