What distinguishes a class from an object?
A class is a blueprint defining shared data and operations; an object is a particular runtime instance of that class.
Study 8 Object-Oriented Design Principles with 12 free online flashcards. Review key terms, definitions, and concepts with this interactive flashcard deck.
What distinguishes a class from an object?
A class is a blueprint defining shared data and operations; an object is a particular runtime instance of that class.
What three characteristics commonly define an object?
An object combines state, behavior, and identity. State is its data, behavior is what it can do, and identity distinguishes it from other objects.
How does encapsulation protect an object?
Encapsulation combines state with behavior and controls access to the representation, allowing the object to protect its invariants.
When is inheritance a sound design choice?
Inheritance is appropriate when a subclass genuinely satisfies the parent type’s behavioral contract, not merely when it can reuse a few methods.
What does polymorphism allow?
Polymorphism lets code use a common type while the actual object supplies the implementation that runs.
What does an interface provide?
An interface defines a contract or capability without requiring clients to know its implementation.
What is composition in object-oriented design?
Composition constructs an object from collaborators that perform parts of its work, allowing behavior to vary by supplying different collaborators.
What does the Information Expert principle prescribe?
The Information Expert principle assigns an operation to the object that has the information needed to perform it.
Which class should usually create an object?
The Creator rule assigns creation to a class that closely uses, aggregates, contains, or records the object being created.
What does cohesion measure?
Cohesion measures how closely a class’s responsibilities belong together. High cohesion means the class has a focused, meaningful purpose.
What does coupling measure?
Coupling measures how strongly one class or module depends on others. Good design aims for few, stable, explicit dependencies on suitable abstractions.
What is dependency injection?
Dependency injection supplies collaborators from outside an object instead of having the object construct them internally.
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.