Skip to content

Instantly share code, notes, and snippets.

@ollehallin
Created May 13, 2015 12:30
Show Gist options
  • Save ollehallin/5a1b33c957b948f80bc4 to your computer and use it in GitHub Desktop.
Save ollehallin/5a1b33c957b948f80bc4 to your computer and use it in GitHub Desktop.
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