Loops


Loop Often used for loops that... Termination condition is checked each time... Head- / foot-controlled Loop body... Explained in video*
do-while should be executed at least once after the loop body has been executed foot-controlled loop is executed at least once Lesson 47
while might never be executed before the loop body will be executed head-controlled loop might never be executed Lesson 52
for iterate through an array if an iteration counter is needed before the loop body will be executed head-controlled loop might never be executed Lesson 207
for-each iterate through an array if no iteration counter is needed before the loop body will be executed head-controlled loop might never be executed Lesson 210


Break & continue


Keyword Context Description Explained in video*
break loops Immediately terminates the loop. Control flow jumps to the first statement behind the loop. Lesson 55
continue Skips the rest of the loop body. Control flow jumps to the check of the termination condition. Depending on the termination condition the loop is continued or terminated. Lesson 243
* Please buy the course Java for newcomers and log in to udemy.com to watch the explanation videos.