Advertisement
sissou123

Untitled

Mar 31st, 2022
790
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.54 KB | None | 0 0
  1. There are two kind of loops in Java, for and while.
  2. For
  3.  
  4. The for loop has three sections:
  5.  
  6. for (int i = 0; i < 3; i++) {}
  7.  
  8. First section runs once when we enter the loop.
  9.  
  10. 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.
  11.  
  12. The third section is the final statement that will run every time the loop runs.
  13. for more:https://gurl.pw/lJnX
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement