Ch_7_Classes_And_Objects Flashcards

1
Q

::

A

Scope Resolution operator. It is needed to indicate class member functions and to inform the compiler which class it belongs to.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Member Function (Methods)

A
  • A function that belongs to a class.
  • The procedures that an object performs.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Class

A
  • A programmer-defined data type used to define objects.
  • The primary construct used to create objects.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Types of Member Functions (Methods)

A
  • Acessor, get, getter function
    -Mutator, set,setter function
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Access Specifier

A
  • Public or Private
  • Specify which member variables and member function are accessible from inside and outside the class.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Data Hiding

A
  • Refers to an object’s ability to hide its data from code outside the object.
  • Only the object’s member functions can directly access and make changes to its data.
  • An object typically hides its data, but allows outside code to access it through some of its member functions.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Encapsulation

A

Data and method together

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Abstract Data Type

A

Any data type whose implementation details are kept separate from the logical properties needed to use it.

A data type that specifies the values the data type can hold and the operations that can be done on them without the details of how the data type is implemented.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Abstraction

A

A general model of something.

A definition that includes only the general characteristics of an object without the details that characterize specific instances of the object.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Data Abstraction

A

Separation of a data type’s logical properties from its implementation details.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Procedural Programming

A

A method of writing software centered on the procedures, or functions, that carry out the actions of the program.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Object Oriented Programming

A

A method of writing software that is centered on objects.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Objects

A
  • A software entity that combines both data and the procedures that work with it in a single unit.
  • Instances of a class.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Attributes

A

An objects data items. Stored in member variables.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Encapsulation

A

The bundling of an object’s data and procedures.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Instantiation

A

Defining a class.

17
Q

Accessor (Get Functions; Getter)

A

A member function that USES the value of a class variable, but does not change it.

18
Q

Mutator (Set Functions; Setter)

A

A member function which stores a value in a member variable, or changes its value.

19
Q

Inline Function

A

Member functions that are defined within the class definition.

20
Q

Function Implementation

A

A member function definition that is placed outside of the class declaration. A member function prototype will be placed in the class declaration.

21
Q

Stale Data

A

Member data that has an external dependency and wasn’t changed when the dependency was changed.

22
Q

Stack

A

Section of memory that holds the following when a regular function is called.
- Return address for when the function finishes executing.
- Values of the function arguments.

23
Q

Constructor

A

A special PUBLIC member function that is automatically called when a class object is created.

24
Q

Default Constructor

A

A constructor which has no parameters.

25
Q

Member Initialization List

A

A list of member variable names with their initial values that appears after the constructor heading and before the opening brace of the body.

26
Q

In-place initialization

A

Beginning with C++11 you can initialize member variables when they are defined inside the class declaration.

27
Q

Constructor Delegation

A

In C++ 11, it is possible for one constructor to call another constructor in the same class.

28
Q

Destructor

A
  • A member function that is automatically called when an object is destroyed.
  • Public member functions with the same name as the class, preceded by a tilde character (~).
  • Have no return type, similar to constructors.
  • Cannot accept arguments, so they never have a parameter list.
  • There can only be one destructor.

Most useful when working with objects that are dynamically allocated.

29
Q

Private Member Functions

A
  • Member functions that may only be called from a function that is a member of the same class.
30
Q

Constant Reference

A

To protect an object when it is passed as an argument, without having to make a copy, it can be passed a a constant reference.

This means that a reference to the original object is passed to the function, but it cannot call any mutator functions or change any of the object’s member data.

It can only call accessor functions that have themselves been designated as constant functions.

31
Q

Object Composition

A

When one class is nested inside another.

32
Q

Class Specification File

A

A header file that contains a class declaration.

33
Q

Class Implementation File

A

A separate .cpp file that includes the member function definitions.

34
Q

Structure

A

A programmer-defined data type that can hold many different data values.

35
Q

Object Oriented Analysis Process

A
  1. Identity the classes and objects to be used in the program.
  2. Define the attributes for each class.
  3. Define the behaviors for each class.
  4. Define the relationships between classes.
36
Q

Class Attributes

A

The data elements used to describe an object instantiated from the class.

37
Q

Relationships Between Classes

A
  • Access
  • Ownership (Composition)
  • Inheritance