Learn Java Tutorial for Beginners (Video), Part 4: While Loops

In the fourth part of the Java tutorial for beginners video series using Eclipse, we look using loops to make your code repeat statements multiple times. We also take a look at conditions.



Code for this tutorial:

 
public class Application {
    public static void main(String[] args) {
        
        int value = 0;
    
        while(value < 10)
        {
            System.out.println("Hello " + value);
            
            value = value + 1;
        }
    }
}

 
Hello 0
Hello 1
Hello 2
Hello 3
Hello 4
Hello 5
Hello 6
Hello 7
Hello 8
Hello 9