It's not a secret anymore!
The moose likes I/O and Streams and the fly likes I/O Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "I/O" Watch "I/O" New topic


naveen babu

Joined: Nov 10, 2004
Posts: 8
how can i get multiple line input using from console BufferedReader class
how can i get multiple line input using from console using any class.
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
Can you describe the problem in more detail? What kind of input are you expecting? Is it typed by a human user?

ReadLine is of course going to get you one line. For multi-line input you'd just call it repeatedly. I'm guessing you'd have trouble knowing when one group of lines is done and it's time to process them? Maybe make the user type a "fence" to indicate the end, eg a blank line or a special character.

A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
I agree. Here's the link:
subject: I/O
It's not a secret anymore!