What is the difference between a Java class and an object?
A class is a definition or blueprint; an object is a distinct instance created from that class.
Study 08 Objects and Encapsulation with 12 free online flashcards. Review key terms, definitions, and concepts with this interactive flashcard deck.
What is the difference between a Java class and an object?
A class is a definition or blueprint; an object is a distinct instance created from that class.
What three characteristics define an object?
An object’s state is its stored data, behavior is supplied by its methods, and identity distinguishes it from other instances.
What is a field in Java?
A field is a variable declared inside a class; instance fields normally give each object its own stored state.
What does an instance method operate on?
An instance method operates on a particular object and can use or modify that object’s instance fields.
What is a Java constructor?
A constructor initializes a newly created object. It has the class’s name and no return type, not even `void`.
What does the `new` operator do?
The `new` operator creates an object by executing a constructor call; the resulting reference can be stored in a variable.
How is an instance method invoked?
The dot operator invokes an instance method through a reference, such as `account.deposit(40.00)`.
What does `this` refer to in an instance method?
Inside an instance method, `this` refers to the object on which the method was invoked.
What is constructor overloading?
Constructor overloading provides multiple constructors with different parameter lists, allowing several valid ways to create an object.
What happens when `alias = original` is assigned?
Assigning one reference to another copies the reference, not the object, so both variables can identify the same object.
How does primitive assignment differ from reference assignment?
Assigning one primitive variable to another copies the value, so later changes to one variable do not change the other.
What does `null` mean for a Java reference?
`null` means a reference refers to no object. Calling an instance method through it causes a `NullPointerException`.
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.
A structured guide to the main data structures, their operations, efficiency trade-offs, representations, and practical selection criteria.
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.