/*
 * Loops
 * 
 * @author neonprimetime, neo, "the one" 
 * @website http://www.geocities.com/neonprimetime.geo/
 * 
 */
public class first_loops{

	public static void main(String[] args){
	// variables we will use
	int counter1 = 0 ;
	int counter2 = 0 ;
	
	// while loops are very simple,
	// the block of code inside the while
	// loop will continue to run, over and
	// over again until the condition
	// inside the while statement is true
	System.out.println("WHILE LOOP") ;
	while(counter1 < 5){
		System.out.println("counter1 = " + counter1) ;
		counter1 = counter1 + 1 ;
	}//end of 'while' loop
	System.out.println("outside while loop, counter1 = " + counter1 + "\n") ;

	// do-while loops are the exact same thing
	// as while loops, with one execption...
	// a do-while loop will ALWAYS run atleast
	// once before terminating because the condition
	// in the while statement isn't checked until the end
	System.out.println("DO-WHILE LOOP") ;
	do{
		System.out.println("counter2 = " + counter2) ;
		counter2 = counter2 + 1 ;
	}while(counter2 < 5) ; // end of 'do-while' loop
	System.out.println("oustide do-while loop, counter2 = " + counter2 + "\n") ;

	// for loops are a bit more complicated that while and
	// do-while loops, but they are also more powerful
	// for loops have 3 different parameters:
	// for( DECLARATIONS ; CONDITION ; INCREMENTATION ) { }
	// DECLARATIONS are where you declare a variable and
	//              give it an initial value
	// CONDITION is when you want the loop to keep running
	// INCREMENTATION is where you change your variable's values
	//                so that sooner or later your loop will stop
	//                running  (you don't want an infinite loop)
	System.out.println("FOR LOOP") ;
	for(int variable1 = 0 ; variable1 < 5 ; variable1 = variable1 + 1)
		System.out.println("variable1 = " + variable1) ;

	}//end of 'main' method
}// end of 'DataTypes' class