Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- There are two kind of loops in Java, for and while.
- For
- The for loop has three sections:
- for (int i = 0; i < 3; i++) {}
- First section runs once when we enter the loop.
- Second section is the gate keeper, if it returns true, we run the statements in the loop, if it returns false, we exit the loop. It runs right after the first section for the first time, then every time the loop is finished and the third section is run.
- The third section is the final statement that will run every time the loop runs.
- for more:https://gurl.pw/lJnX
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement