Java Flow Control Flashcards

1
Q

The ___ statement in Java allows a program to execute different statements based on
whether a certain condition is true or false.

A

If… else

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

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.

A

switch statement

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

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.

A

for loop

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

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.

A

for-each loop

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

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.

A

while loop

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

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.

A

break statement

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

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.

A

continue statement

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

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.

A

array

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

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.

A

multidimensional array

How well did you know this?
1
Not at all
2
3
4
5
Perfectly