What is a class in object-oriented programming?
A class is a programmer-defined type that specifies the structure and behavior its objects will have.
Study 2 Classes and Objects with 12 free online flashcards. Review key terms, definitions, and concepts with this interactive flashcard deck.
What is a class in object-oriented programming?
A class is a programmer-defined type that specifies the structure and behavior its objects will have.
What is an object, or instance?
An object is a concrete runtime value created from a class; it is also called an instance of that class.
What does instantiation mean?
Instantiation is the process of creating an object from a class.
What is an attribute?
An attribute is a named value associated with a class or object, such as `checking.balance`.
What does an object's state describe?
An object's state is the collection of its attribute values at a particular moment.
What is a method?
A method is a function associated with a class that defines an operation an object can perform or have performed on its behalf.
What is the role of `self` in a Python instance method?
In Python, an instance method conventionally receives the instance as its first parameter, usually named `self`; Python supplies it automatically for an object call.
How do class and instance attributes differ?
A class attribute is shared by a class or its instances, while an instance attribute belongs to one particular object.
Why can mutable class attributes be dangerous?
A mutable class attribute, such as a list or dictionary, is shared, so a change through one instance can be visible through other instances.
What does Python's `__init__()` do?
In Python, `__init__()` is an initializer called automatically after a new instance is created to establish its initial state.
What identifies a Java constructor?
A Java constructor has the same name as its class and has no return type; it is invoked during object creation.
How do object identity and equality differ?
Identity asks whether two references designate the exact same object; equality asks whether their values compare as equal.
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.