What is encapsulation?
Encapsulation keeps an object’s state and the operations that control that state together, while restricting uncontrolled outside access.
Study 3 Encapsulation and Abstraction with 12 free online flashcards. Review key terms, definitions, and concepts with this interactive flashcard deck.
What is encapsulation?
Encapsulation keeps an object’s state and the operations that control that state together, while restricting uncontrolled outside access.
What does abstraction present?
Abstraction presents an object’s important capabilities while omitting unnecessary implementation details.
What is the purpose of information hiding?
Information hiding prevents clients from depending on implementation details that may change, such as a storage system’s database schema.
What does access control define?
Access control defines which code may use a type or member. Common levels include public, private, protected, and internal or package-private.
What visibility principle should a class follow?
Use the narrowest visibility that supports the design. This reduces accidental misuse and limits dependencies on implementation details.
What is a property?
A property provides field-like syntax while allowing custom behavior when a value is read or changed, such as validation or computation.
What is an invariant?
An invariant is a condition that must remain true for every valid object state, such as a date range whose end is not earlier than its start.
How does validation differ from normalization?
Validation rejects unacceptable input; normalization transforms acceptable but variable input, such as trimming surrounding whitespace.
What does valid-by-construction mean?
A valid-by-construction object is valid immediately after successful construction because its required conditions were checked during creation.
Why should a class avoid returning an internal mutable collection?
Returning an internal mutable collection lets callers change private state without following the class’s rules. Use a read-only view, defensive copy, or immutable value instead.
Why should a public interface be minimal?
A smaller public interface is easier to understand, test, document, and change because every public member is a potential client dependency.
What is the difference between a precondition and a postcondition?
A precondition states what callers must provide before an operation can succeed; a postcondition states what success guarantees afterward.
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.