Free Online Flashcard Deck

09 Introduction to Object-Oriented Programming Free Online FlashCards

Study 09 Introduction to Object-Oriented Programming with 12 free online flashcards. Review key terms, definitions, and concepts with this interactive flashcard deck.

12 cards
01
Front

What does a C++ class define?

Back

A class defines a user-defined type, including its representation, behavior, and interface.

02
Front

What is an object in OOP?

Back

An object is an instance of a class: a concrete value that combines state with operations on that state.

03
Front

What is a class invariant?

Back

An invariant is a condition that should remain true for every valid object, such as a bank balance that cannot be changed through unrestricted outside access.

04
Front

What does abstraction mean in OOP?

Back

Abstraction exposes an object’s essential operations while hiding implementation details that callers do not need to know.

05
Front

What does `= 0` mean on a virtual function?

Back

A pure virtual function is declared with `= 0`; a class containing one is abstract and cannot be instantiated directly.

06
Front

What is encapsulation?

Back

Encapsulation combines data with the operations that manage it and controls access to the internal representation.

07
Front

Who can access a C++ `private` member?

Back

A `private` member is accessible only to the class’s members and permitted friends; outside code must use the public interface.

08
Front

What are C++'s default member access levels?

Back

Members of a `class` are `private` by default, while members of a `struct` are `public` by default.

09
Front

What relationship does composition model?

Back

Composition builds a class by storing objects of other classes as members; it expresses a “has-a” relationship.

10
Front

When should inheritance be used?

Back

Inheritance defines a new class in terms of an existing base class and can express a specialized, substitutable form of that base.

11
Front

What does `override` verify in C++?

Back

The `override` specifier asks the compiler to verify that a derived member actually overrides a virtual base member.

12
Front

What is dynamic dispatch?

Back

Dynamic dispatch selects the implementation at runtime based on the concrete object, even when called through a base reference or pointer.