wiley_pastebin

scanner 1

Mar 15th, 2019
3,050
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.27 KB | None | 0 0
  1. //...
  2. Scanner s = new Scanner(System.in);
  3.  
  4. private void demoInput() {
  5.  String userin;
  6.  do {
  7.   System.out.println("Insert some text: ");
  8.   userin = s.nextLine();
  9.  
  10.   System.out.println("You said: " + userin);
  11.  } while(!userin.equals("quit"));
  12.  
  13. }
  14. //...
Advertisement
Add Comment
Please, Sign In to add comment