Created
November 28, 2011 08:34
-
-
Save mojaie/1399629 to your computer and use it in GitHub Desktop.
Example:Scanner.hasNext
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
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