Java for Complete 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

Learn to program Java Swing with my complete video course - desktop programming and applets. Includes 7 free videos. Click here for details.

All pages on this site are copyright © 2013 John W. Purcell

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Posted in Java, Java Tutorial, Java Video Tutorials (Beginners) | Tagged , , , |