What is the difference between a class and an object?
A class defines shared structure and behavior; an object is a particular class instance with its own state.
Study 8 Object-Oriented Design with 12 free online flashcards. Review key terms, definitions, and concepts with this interactive flashcard deck.
What is the difference between a class and an object?
A class defines shared structure and behavior; an object is a particular class instance with its own state.
What does encapsulation protect?
Encapsulation combines data with governing operations, restricts direct access to representation, and protects invariants through a meaningful public interface.
When is inheritance appropriate?
Inheritance is appropriate when a subtype genuinely satisfies the behavioral contract of its supertype; otherwise, its coupling and rigidity can outweigh reuse.
How does polymorphism reduce conditional logic?
Polymorphism lets code use an abstraction while the concrete object selects the implementation, reducing conditional logic and easing the addition of new implementations.
What does an interface specify?
An interface specifies a contract of operations without requiring a particular implementation, allowing different classes to provide the same capability independently.
What is composition in object-oriented design?
Composition builds a class from references to other objects, allowing behavior to be replaced at runtime and making testing with substitute objects easier.
What is the information expert guideline?
The information expert guideline assigns behavior to the object that has the information needed to perform it. For example, an Order should usually calculate its own total.
What is pure fabrication?
Pure fabrication creates a focused service that is not a domain entity when doing so improves cohesion and reduces coupling, such as an InvoicePrinter.
What does high cohesion indicate?
Cohesion measures how closely a module’s responsibilities belong together. High cohesion gives a class a focused purpose and makes it easier to understand, test, reuse, and change.
Why should coupling be limited?
Coupling measures how strongly modules depend on one another. Low, intentional coupling limits ripple effects by using stable abstractions, necessary information, and hidden implementation details.
What does the Single Responsibility Principle require?
The Single Responsibility Principle says a class should have one coherent responsibility and one primary reason to change; it does not require the class to contain only one method.
What is the Open–Closed Principle?
The Open–Closed Principle says software entities should be open for extension but closed for modification, often by placing variation behind an abstraction such as ShippingStrategy.
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.