Programming Course for Beginners - ZedLX

The Easiest Online Computer Programming Course, for Free

Iteration [4/10]

In this example, the body of the for loop consists of three statements inside a statement block.
[Run the program]

The argument of sleepMs function equals 500 in this program; it specifies the sleep time in milliseconds. 500 milliseconds equals exactly one half of a second.

Exercise:

1. Inside the body of the for loop, insert a new statement: println i;

Loading...