Skip to content

Instantly share code, notes, and snippets.

@mojaie
Created November 28, 2011 08:34
Show Gist options
  • Save mojaie/1399629 to your computer and use it in GitHub Desktop.
Save mojaie/1399629 to your computer and use it in GitHub Desktop.
Example:Scanner.hasNext
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
String str = new String();
while(in.hasNext()) {
String buf = in.nextLine();
str = str + buf;
}
System.out.println(str);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment