Created
May 13, 2015 12:30
-
-
Save ollehallin/5a1b33c957b948f80bc4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package se.transmode.tnm.server; | |
import java.util.Scanner; | |
public class ScannerTest { | |
public static void main(String[] args) { | |
System.out.print("Enter items, end with Ctrl-D: "); | |
System.out.flush(); | |
Scanner scanner = new Scanner(System.in); | |
while (scanner.hasNext()) { | |
String item = scanner.next(); | |
System.out.println("Read item '" + item + "'"); | |
} | |
System.out.println("Bye, bye!"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment