What is an abstract type?
An abstract type describes what an object can do without requiring its complete representation or implementation.
Study 6 Interfaces and Abstract Types with 12 free online flashcards. Review key terms, definitions, and concepts with this interactive flashcard deck.
What is an abstract type?
An abstract type describes what an object can do without requiring its complete representation or implementation.
What is an interface?
An interface is a named contract that specifies operations an implementing type promises to provide.
What does a complete interface contract specify?
A complete interface contract includes names and signatures, input and output rules, behavioral expectations, failure behavior, and state or side-effect expectations.
What must an interface implementation satisfy?
An implementing type must satisfy both the syntactic contract and the behavioral contract of the interface.
How does polymorphism apply to interfaces?
Polymorphism lets client code use the same interface operation with different concrete implementations, each producing implementation-specific behavior.
What is an abstract class?
An abstract class is a partially implemented base class that may provide state, constructors, implemented methods, and abstract methods for subclasses to complete.
When should you choose an interface over an abstract class?
Use an interface for a capability or contract across potentially unrelated types; use an abstract class when related types need shared state or implementation.
What does the dependency inversion principle recommend?
Dependency inversion means high-level policy depends on abstractions, while low-level implementations conform to those abstractions.
What is dependency injection?
Dependency injection supplies a concrete implementation to a client through a constructor, factory, configuration object, or framework.
When are implementations interchangeable?
Implementations are interchangeable when a client can replace one with another without violating the client's assumptions or the shared contract.
Why should interfaces remain focused?
A focused interface represents one coherent responsibility, such as separate Reader and Writer capabilities, instead of forcing unrelated operations together.
What does it mean to design around client needs?
Design an interface around the operations clients actually need, rather than exposing every operation available on the concrete object.
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.