Advertisement
EXPGamer303

How to Use the Java Do While Loop

Dec 1st, 2016
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.36 KB | None | 0 0
  1. package com.expgamer303.javabasics.whileStuff;
  2.  
  3. public class DoWhile {
  4.  
  5.     public static void main(String args[]) {
  6.        
  7.         int counter = 15;
  8.        
  9.         do {
  10.            
  11.             System.out.println(counter);     //Guaranteed to Run Stuff in Do Brackets Once
  12.             counter++;                       //Runs Again if 'while' is True
  13.            
  14.         } while (counter <= 10);
  15.            
  16.            
  17.            
  18.     }
  19.        
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement