Loops in Java - easy explanation of for, foreach, while and do-while loops

Опубликовано: 03 Май 2026
на канале: Maaike Bright Boost
438
7

In this video I will show you the basic syntax and flow of loops in Java. You will see for, foreach (enhanced for), while and do-while loops in this video. The video explains it slowly and helps you to grasp the basic idea of loops in Java.


This week you’ll learn a few important concepts: arrays, how to store multiple values in one variable. And loops, how to repeat a certain block of code a certain number of times.

Topics
Arrays
Multidimensional arrays
Loops
o While
o Do while
o For
o Foreach (also called “enhanced for loop”)


Content
Arrays and multidimensional arrays
https://www.w3schools.com/java/java_a...
https://www.geeksforgeeks.org/arrays-...
Loops
https://www.geeksforgeeks.org/loops-i...
https://www.javatpoint.com/java-for-loop

Questions
If you have any questions about the content, please write them under the corresponding Youtube video. The questions that are asked most will be discussed in the Saturday session. You can also ask your direct team members and the other participants. Please help each other as much as possible, if you see a question you know the answer too, please answer 😊 We’re doing this together!

Homework
Continue working from last week’s project
Create arrays where we have used String as a temporarily solution (for example, teams in tournament)
In the main method:
o Create a tournament object
o Create team objects
o Assign them to the tournament object
o Loop over the teams and print the names of the players
o Create game and score objects
o Calculate the total number of goals using a loop