Learn Java Tutorial for Beginners (Video), Part 5: For Loops

In the fifth part of the Java tutorial for beginners video series using Eclipse, we look using 'for' loops and printf().



Code for this tutorial:

 
public class Application {
    public static void main(String[] args) {
        
        for(int i=0; i < 5; i++) {
            System.out.printf("The value of i is: %dn", i);
        }
    }
}

 
The value of i is: 0
The value of i is: 1
The value of i is: 2
The value of i is: 3
The value of i is: 4