[OOP] Flashcards - Module 2-3
The most basic decision-making statement
if statement
for-loop component that is only executed once at the start of the loop.
initializer
for-loop component that performs the updates on certain variables that were used in the loop.
iterator
This statement is used in selecting one of many code blocks to be executed. It works by evaluating the ____ expression once. Then, the value of the expression is compared with the values of each case. If it matches the case, the associated block of code will be executed.
switch statement
2 major components of loops
Condition and Expression
values provided to a method when it is invoked. They supply the necessary information for the method to execute its intended operations.
Actual parameters or arguments
The ____ iterates through a block of code as long as a specified condition is true.
while loop
3 Crucial Roles of java
Modularity, Code Reusability, and Ease of Maintenance
four forms of the java loop construct
while loop, for loop, do-while loop, and for-each loop
They function as local variables within the method, receiving the values provided by actual parameters during method calls.
formal parameters
[syntax] method in Java
access_modifier return_type method_name(parameter_list);
//statements
return value; // only if return type not void
3 components of a for-loop
initializer, condition, and iterator
A unique identifier for the method, adhering to Java’s naming conventions for identifiers.
Method Name.
placeholders specified in the method’s declaration or definition.
formal parameters
In ____ loop, repetition is achieved by doing or executing the statement in the loop first, before checking the condition.
do-while
A set of input parameters (if any) that the method requires. If none are needed, empty parentheses are used.
Parameter List
The statements inside an if/if-else statement are enclosed in _____
curly braces
What does ASCII stand for?
American Standard Code for Information Interchange
Defines the visibility and accessibility of the method. Common examples include public, private, and protected.
Access Modifier
loop component that changes the value of the variable used in the condition above. This “change” should eventually lead to breaking the loop, and happens when the condition evaluates to false.
Expression
The block of code where the method’s task is executed.
Method Body
The ASCII Codes range for digits = ____, uppercase = ___, and lowercase letters
48-57 ; 65-90 ; 97-122
for-loop component that behaves similarly with how the condition in the while loop behaves.
condition
[syntax] do-while loop structure
do {
statements
}while(condition);
For methods with a non-void return type, the method must ____ of the specified type using the return statement.
return value
a loop component that checks whether the repetition still needs to be executed.
condition
Specifies the data type of the value the method returns. If the method does not return a value, the void keyword is used.
Return type
If a ___ keyword is reached, it breaks out of the switch block.
break
tool used by programming languages to regulate how a program is executed in response to specific circumstances.
Control Statements
the first character set (encoding standard) used between computers on the Internet.
ASCII