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 progressive guide to Python programming fundamentals, connecting values, expressions, control flow, functions, input, output, and an integrated grade calculator.
A focused set of flashcards covering Python variables, data types, expressions, control flow, functions, input, output, and common programming practices.
A medium-difficulty quiz on Python conditional control flow, including branching, comparison and logical operators, truthiness, short-circuit evaluation, nesting, and common syntax mistakes.
Learn how registers, the ALU, datapath connections, and control logic work together to fetch and execute CPU instructions.
Learn how Boolean expressions, logical operators, and conditional structures let programs make reliable decisions, including how to handle boundaries, branch order, and testing.
A structured guide to the main data structures, their operations, efficiency trade-offs, representations, and practical selection criteria.
A medium-difficulty quiz on interfaces, abstractions, abstract classes, polymorphism, dependency direction, dependency injection, and contract design. The quiz includes 12 required candidates and 2 additional alternate candidates.
A progressive guide to measuring algorithmic time and memory requirements, interpreting asymptotic bounds, analyzing common code patterns, and balancing performance trade-offs.
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 focused review of propositional logic, quantifiers, sets, relations, functions, and foundational proof methods in discrete mathematics for computer science.
A progression through how data is organized, searched, exposed through software interfaces, and managed through abstraction layers in modern computer systems.