C7 Flashcards
(50 cards)
What is the difference between a class and an instance of the class?
A class is a blueprint; an instance is a concrete object created from that blueprint.
What is the default access specification of class members?
private
The two common programming methods in practice today are _________ and _________.
procedural; object-oriented
_________ programming is centered around functions or procedures.
procedural
_________ programming is centered around objects.
object-oriented
_________ is an object’s ability to contain and manipulate its own data.
encapsulation
In C++, the _________ is the construct primarily used to create objects.
class
A class is very similar to a(n) _________.
structure
A(n) _________ is a keyword inside a class declaration that establishes a member’s accessibility.
access specifier
The default access specification of class members is _________.
private
The default access specification of a struct in C++ is _________.
public
Defining a class object is often called the _________ of a class.
instantiation
Members of a class object may be accessed through a pointer to the object by using the _________ operator.
arrow (->)
If you were writing the declaration of a class named BankAccount, what would you name the file it was stored in?
BankAccount.h
If you were writing the external definitions of the BankAccount class’s member functions, you would save them in a file named _________.
BankAccount.cpp
When a member function’s body is written inside a class declaration, the function is _________.
inline
A(n) _________ is automatically called when an object is created.
constructor
A(n) _________ is a member function with the same name as the class.
constructor
_________ are useful for performing initialization or setup routines in a class object.
Constructors
Constructors cannot have a(n) _________ type.
return
A(n) _________ constructor is one that requires no arguments.
default
A(n) _________ is a member function that is automatically called when an object is destroyed.
destructor
A destructor has the same name as the class, but is preceded by a(n) _________ character.
tilde (~)
Like constructors, destructors cannot have a(n) _________ type.
return