wood burning stoves 2.0
The moose likes Beginning Java and the fly likes system.in.read() Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "system.in.read()" Watch "system.in.read()" New topic


Bron Czimes
Ranch Hand

Joined: May 09, 2004
Posts: 44
hi there
just a quick question. is there an alternative to system.in.read() if you want to read more than one character at a time, say, maybe a few words or something...???
David Peterson
Ranch Hand

Joined: Oct 14, 2001
Posts: 154
You can read line-by-line with a BufferedReader.
Dirk Schreckmann

Joined: Dec 10, 2001
Posts: 7023
Yes. You can wrap the System.in InputStream in a BufferedReader, which will allow you to read a line of text a time.
To begin to form a good understanding for how these fancy Streams and Readers work, I recommend reading the I/O Lesson of Sun's Java Tutorial.
[ May 09, 2004: Message edited by: Dirk Schreckmann ]

[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
I agree. Here's the link: http://aspose.com/file-tools
subject: system.in.read()
It's not a secret anymore!