Just reading one line from the standard input...

I just wonder how i can wait for the user to enter some keys folowed by Enter and get the string into a String.System.in.?
[136 byte] By [d00apea] at [2007-11-26 23:44:43]
# 1
Using BufferedReader would worl check this out: http://java.sun.com/j2se/1.5.0/docs/api/index.html
abshirf2a at 2007-7-11 15:16:22 > top of Java-index,Java Essentials,Java Programming...
# 2

> I just wonder how i can wait for the user to enter

> some keys folowed by Enter and get the string into a

> String.

>

> System.in.?

Better yet, I'll do you a favor and point you to the Java API documentation, where you can find simple things like this yourself now and in the future.

http://java.sun.com/j2se/1.5.0/docs/api/index.html

And here's the standard I/O tutorial:

http://java.sun.com/docs/books/tutorial/essential/io/index.html

warnerjaa at 2007-7-11 15:16:22 > top of Java-index,Java Essentials,Java Programming...
# 3
Ok! Thanks!So the simplest way I can get input from the user in Eclipse is like this:BufferedReader br = new BufferedReader(new InputStreamReader(System.in));String strIn = br.readLine();?
d00apea at 2007-7-11 15:16:22 > top of Java-index,Java Essentials,Java Programming...