03 Java Loops Flashcards
Same statement is being repeated many times over, and at some point has to stop.
Iteration
It checks whether the repetition still needs to be executed.
Condition
It changes the value of the variable used in the condition.
Expression or statement
It iterates through a block of code as long as a specified condition is true.
While loop
It is used if you know exactly the number of times you want to loop through a block of code.
For loop
It is once executed at the start of the loop.
Initializer
It behaves similarly with how the condition in the while loop behaves.
Condition
It performs the updates on certain variables that were used in the loop.
Iterator
Repetition is achieved by doing or executing the statement in the loop first, before checking the condition.
do-while Loop
It is when another loop exists in the body of another loop.
Nested loop
It terminates the loop immediately, and the control of the program will move to the next statement after the loop.
Break
It moves to the end of the iteration, and then the test expression is evaluated, and the update statement is evaluated in case of the for loop.
Continue
_____ is used for the outer loop, while ______ is used for the inner loop.
break, continue