Java Reference

Java Reference Home | Smart Soft Home

for

Category

Loops

Description

Defines a block of statements that will be i number of times. This just a condensed form of the while loop.

Example

for(int i=0;i<10;i++){
    System.out.println("Do this 10 times");
    System.out.println("Do this 10 times");
    System.out.println("Do this 10 times");
}