Java Flow Control Flashcards
The ___ statement in Java allows a program to execute different statements based on
whether a certain condition is true or false.
If… else
The ___ in Java allows a program to execute different statements based on the
value of an expression.
The ___ consists of a value or expression followed by a series of cases. If the value
of the expression matches a case, the corresponding block of code is executed.
switch statement
The ___ in Java is used for iterating over a range of values.
The ___ consists of three parts: initialization, condition, and increment. The loop executes
as long as the condition is true, and the increment is applied at the end of each iteration.
for loop
The ___ in Java is used for iterating over arrays or collections.
The ___ automatically iterates over each element in the array or collection and assigns it to a variable.
for-each loop
The ___ in Java is used for repeating a block of code as long as a certain condition is true.
The ___ consists of a condition, and the block of code is executed repeatedly as long as
the condition is true.
while loop
The ___ in Java is used to exit a loop or switch statement.
When the ___ is encountered, the program jumps to the statement immediately following the loop or switch statement.
break statement
The ___ in Java is used to skip the current iteration of a loop and move on to the next iteration.
When the ___ is encountered, the program jumps to the condition of the loop and checks whether the condition is still true.
continue statement
An ___ in Java is a collection of elements of the same type.
___ are used to store multiple values in a single variable and provide a way to access those values through an index.
array
A ___ in Java is an array of arrays.
In a two-dimensional array, each element is identified by two indices, one for the row and one
for the column. In a three-dimensional array, each element is identified by three indices, and so on.
multidimensional array