Do...while repetition statement. - Java Language Basics

Java examples for Language Basics:do while

Description

Do...while repetition statement.

Demo Code

public class Main 
{  //  ww w  . ja  v a  2 s . com
   public static void main(String[] args)
   {
      int counter = 1; 

      do 
      {
         System.out.printf("%d  ", counter);
         ++counter;
      } while (counter <= 10); // end do...while 

      System.out.println(); 
   } 
}

Result


Related Tutorials