Do While : While « Language Basics « Java






Do While

Do While

public class DoWhile {
  public static void main(String[] av) {

    int i = 5;
    do {
      System.out.println("i = " + i--);
    } while (i>=0);
  }
}


           
       








Related examples in the same category

1.while Demowhile Demo
2.Do While DemoDo While Demo
3.Demonstrates the while loop.Demonstrates the while loop.
4.Java labeled while loop.Java labeled while loop.
5.uses a do-while loop to get this input from the user