Advertisement
mrScarlett

do while

Oct 1st, 2016
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class EventLoopDo{
  4. public static void main (String[] args){
  5. int userInteger;
  6. Scanner userInput = new Scanner(System.in);
  7. System.out.print("Enter an integer Value 0 to quit: ");
  8. do{
  9. userInteger=userInput.nextInt();
  10. System.out.println("You entered "+userInteger);
  11. }while (userInteger !=0);
  12.  
  13. System.out.println("You have selected to quit");
  14. }
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement