Learning Java – (Video 5) Tutorial Series – Loop Statements

This is fifth video in the series of Learning Java, In this video loop statements like for, do-while and while loop are explained.

If you feel this video is useful, Please share it with your friends on Facebook, twitter Google plus etc.
 

Code developed in this tutorial provided below:


/**
 * @author Niranjan
 *
 */
public class LoopStatements {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub

		for(int i=6;i<5;i++){
			System.out.println("Value of i inside for loop="+i);
		}
		
		int j = 6;
		do{
			System.out.println("Value of j inside do-while loop ="+j);
			j = j +1;
		}while(j<5);
		
		
		int k = 6;
		while(k<5){
			System.out.println("Value of k inside while loop="+k);
			k = k +1;
		}
	}

}

 
For further reading refer Java Programming Category posts.

Learning Java Loop Statements Example
Tagged on:     

Leave a Reply

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