JAVA · ОСНОВЫ · LESSON 05
Repeat the action.
for loop · about 15 minutes
Learning with progressRead the summary for free. To save the work, log in to the account.
Type the code yourself
Dial the loop manually. Make sure the output is inside the brackets.
public class Main {
public static void main(String[] args) {
for (int count = 1; count <= 3; count++) {
System.out.println(count);
}
}
}Open the editor for class workSolve it yourself
Inside main, write the for loop. Let the variable step output numbers from 1 to 4 inclusive, each on a new row.
The answer is hidden. Use similar examples from the lesson notes.
Opening up your homework