What is a C++ class?
A class is a user-defined type that combines data with the functions operating on that data; its definition describes objects but usually creates none.
Study 8 Classes and Introductory Object-Oriented Programming with 12 free online flashcards. Review key terms, definitions, and concepts with this interactive flashcard deck.
What is a C++ class?
A class is a user-defined type that combines data with the functions operating on that data; its definition describes objects but usually creates none.
How do default access rules differ for struct and class?
Struct members are public by default, whereas class members are private by default. Both can contain the same kinds of members.
What are data members and member functions?
A data member stores an object’s state; a member function defines an operation associated with that object.
What does `const` after a member function mean?
The trailing `const` promises not to modify the object’s observable state, so the function can be called on a `const` object.
What does `ClassName::memberName` identify?
The scope resolution operator `::` identifies a class member when that member function is defined outside the class body.
What is encapsulation?
Encapsulation combines data and operations while controlling access, allowing a class to enforce rules instead of permitting arbitrary state changes.
What do public, private, and protected control?
`public` permits general access, `private` limits access to the class and its friends, and `protected` also permits access from derived classes.
What is a constructor?
A constructor initializes an object automatically; it has the class’s name and no return type, not even `void`.
Why use a member initializer list?
A member initializer list initializes data members before the constructor body executes and is the preferred initialization method.
What does `explicit` prevent on a single-argument constructor?
`explicit` prevents an undesirable implicit conversion by requiring construction to be written explicitly in relevant contexts.
When do you use `.` versus `->`?
Use `.` with an object and `->` with a pointer to an object. `pointer->member` is equivalent to `(*pointer).member`.
What relationship does public inheritance express?
Public inheritance expresses an “is-a” relationship: a derived object can be treated as an object of its public base type.
A 14-question medium-difficulty quiz on Boolean algebra, logic gates, truth tables, and combinational circuits.
A focused set of flashcards covering Python variables, data types, expressions, control flow, functions, input, output, and common programming practices.
Learn how Boolean expressions, logical operators, and conditional structures let programs make reliable decisions, including how to handle boundaries, branch order, and testing.
Learn how computer memory stores and addresses information, how RAM and ROM differ, and how caches and the memory hierarchy balance speed, capacity, and cost.
A progressive guide to tree structure, binary-tree traversals, binary search tree operations, deletion, balancing, and the way tree height determines time and space costs.
A practical guide to integrating problem definition, data representation, modular programming, algorithms, complexity analysis, testing, correctness, and ethical evaluation into a responsible computer science capstone.
Reviews how interrupts support event handling and multitasking, and how Linux system calls use the RISC-V `ecall` instruction and register conventions.
This quiz covers process management, context switching and scheduling, multitasking, traps and interrupts, and RISC-V privilege transitions.
A quiz on operating-system system calls, including privileged-operation requests, process creation and execution with fork, exec, and waitpid, and signal handling.