click below
click below
Normal Size Small Size show me how
Classes & Data Abstr
Classes and Data Abstraction
| Question | Answer |
|---|---|
| Components of a class are called the ___________ of the class | members |
| Members of a class are accessed by ___________ | name |
| Members of a class are classified into one of three categories: ___________, ___________, and ___________ | private protected public |
| The private members of a class are ___________ of the class | not accessible outside of |
| The public members of a class are ___________ of the class | accessible outside |
| By default, all members of a class are ___________ | private |
| The ___________ members are declared using the member access specifier public and the colon : | public |
| The ___________ members are declared using the member access specifier private and the colon : | private |
| A ___________ of a class can be a function or a variable | member |
| If any member of a class is a function, you usually use the ___________ to declare it | function prototype |
| If any member of a class is a variable, it is declared like ___________. | any other variable |
| In C++, a class is a definition. No memory is allocated for the class itself; memory is allocated for the class variables when you ___________ them. | declare |
| A class ___________ is accessed using the class variable name, followed by the dot operator (.), followed by the member name. | member |
| As parameters to functions, classes can be ___________ either by value or by reference. | passed |
| A function can return a value of type ___________. | class |
| A member function of a class that only accesses (that is, does not modify) the value(s) of the member variable(s) is called an ___________ function. | accessor |
| A member function of a class that modifies the value(s) of the member variable(s) is called a ___________ function. | mutator |
| A member function of a class is called a constant function if its heading contains the reserved word ___________ at the end. Moreover, a constant member function of a class cannot modify the member variables of the class. | const |
| ___________ guarantee that the member variables are initialized when an object is declared. | constructors |
| The name of a constructor is the same as the name of the ___________. | class |
| A class can have ___________ one constructor. | more than |
| A constructor without parameters is called the ___________ constructor. | default |
| Constructors automatically execute when a class object ___________ its scope. | enters |
| Destructors automatically execute when a class object ___________ of scope. | goes out |
| A class can have ___________ one destructor, and the destructor has no parameters. | only |
| The name of a destructor is the ___________ , followed by the class name (no spaces in between). | tilde (~) |
| Constructors and destructors are functions ___________ any type; that is, they are neither value-returning nor void. As a result, they cannot be called like other functions. | without |
| A data type that separates the logical properties from the implementation details is called an ___________. | abstract data type (ADT) |
| A public static member, function or variable, of a class can be accessed using the class name and the ___________. | scope resolution operator |
| For each static variable of a class, C++ allocates only one memory space. All objects of the class refer to the ___________ memory space. | same |
| static member variables of a class exist even when ___________ object of the class type exists. | no |
| Non-static member variables of a class are called the ___________ variables of the class | instance |