public class WhileLoop { public static void main(String args[]){ int x = 2; // while loop while( x < 10 ){ System.out.println(x++); } System.out.println("What's x now?"); System.out.println(x); while( x < 10 ){ System.out.println(x++); } System.out.println("-----------------"); // do-while x = 2; do{ System.out.println(x++); }while( x < 10 ); System.out.println("What's x now?"); System.out.println(x); do{ System.out.println(x++); }while( x < 10 ); } }