Chapter 7 Flashcards
Introduction to Classes and Objects
True/False: Object-oriented programming is centered around objects that include both data and the functions that operate on them.
True
True/False: ADT stands for Algorithmic Data Type.
False
Which of the following statements about ADTs are true:
A) They specify the values the data type can hold.
B) They specify the operations the data type can perform.
C) They hide the details of how the data type is implemented.
D) All of the above.
E) A and B, but not C.
D
True/False: A class declaration provides a pattern for creating objects, but doesn’t make any objects.
True
An object typically hides its data, but allows outside code to access it through its …
public member functions
In OOP terminology, an object’s member variables are often called its [Blank], and its member functions are sometimes referred to as its [Blank].
attributes, methods
When three different objects of a class are created, they are said to be separate [Blank] of the class.
instances
When the body of a member function is defined inside a class declaration, it is called a(n) [Blank] function.
inline
True/False: A constructor is a public class function that is automatically invoked (i.e. called) whenever a class object is created.
True
True/False: A class must have exactly one constructor.
False
A constructor may have a return type of …
None
A constructor that does not require that any arguments be passed to it is called a(n) [Blank] constructor.
default
A destructor is a member function that …
is automatically called when an object is destroyed
A(n) [Blank] member function may be called by a statement in a function that is outside of the class.
public
A C++ member function that uses, but does not change, the value of a member variable is called …
an accessor.