Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class EventLoops{
- public static void main (String[] args){
- int userInteger;
- Scanner userInput = new Scanner(System.in);
- System.out.print("Enter an integer Value 0 to quit: ");
- //This line is saying while the user does not enter 0 run the code given in the curly brackets.
- while ((userInteger = userInput.nextInt()) !=0){
- System.out.println("You entered "+userInteger);
- }
- System.out.println("You have selected to quit");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement