[JAVA] Complex for statement (basic)

Complex for statement

❶ Initialization process ❷ Repeat condition ❸ Repeat processing is devised to realize advanced repetition

It is not a simple repetition of "repeat ◯◯ times", but a little advanced repetition can be done by doing the following.

//Start loop variable from 1
for (int i = 1; i < 10; i++){...}

//Increase the loop variable by 2
for (int i = 0; i < 10; i += 2){...}

//Decrease the loop variable from 10 to 1 by 1
for (int i = 10; i > 0; i--){...}

//Do not initialize loop variables
for (; i < 10; i++){...}

//Do not perform repetitive processing
for (int i = 0; i < 10;){...} 

Recommended Posts

Complex for statement (basic)
[Java] Basic statement for beginners
Java for statement
[Java] for statement, while statement
[Java] for statement / extended for statement
(Memo) Java for statement
About for statement and if statement
Basic usage notes for Jackson
Points for refactoring (if statement)
Let's learn SQL SELECT statement for beginners
must not return in the for statement
Java, for statement / while statement starting from beginner