What is a Java method?
A method is a named block of code that performs a task, can receive parameters, and may return a value.
Study 5 Methods and Modular Design with 12 free online flashcards. Review key terms, definitions, and concepts with this interactive flashcard deck.
What is a Java method?
A method is a named block of code that performs a task, can receive parameters, and may return a value.
What is modular design?
Modular design builds a program from small components that can be developed, tested, and reused independently.
What parts commonly make up a Java method declaration?
A Java method declaration commonly includes a modifier, return type, name, parameter list, and method body.
What is the difference between parameters and arguments?
Parameters are variables declared by a method to describe expected inputs; arguments are the actual values supplied when the method is called.
How is a Java method called?
A method call writes the method name followed by parentheses and begins executing that method with the supplied arguments.
What does the `void` return type mean?
`void` indicates that a method performs an action without returning a value. It may use `return;` to end execution early, but cannot return a value.
How does Java pass object and array arguments?
Java passes arguments by value. For objects and arrays, the copied value is a reference, so a method can change shared contents but cannot replace the caller's reference by reassigning its parameter.
Why return a calculation instead of always printing it?
A return value communicates a result to the caller, which can store, print, compare, or pass that result to another method.
What does variable scope mean?
Scope is the region of a program in which a declared name can be referred to. A local variable is normally available only within its method or declaration block.
What is decomposition in program design?
Decomposition divides a large problem into smaller tasks, assigns each task to a method, and combines those methods through a controlling method.
What does a method contract describe?
A method contract states its purpose, inputs, output, assumptions, and side effects.
What is method overloading?
Overloading defines methods with the same name but different parameter lists. The compiler selects the version whose parameter types match the call.
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.