wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes about Readline() Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "about Readline()" Watch "about Readline()" New topic
Author

about Readline()

y bin
Greenhorn

Joined: Feb 18, 2004
Posts: 4
how can I let usr input three number continuously and assign to various
variable?
this is part of the program,any body can teach me?thanks
--
try{
InputStreamReader isr = new InputStreamReader(System.in);
BufferedReader br =new BufferedReader(isr);
System.out.println("please input [n, a_min, a_max]: ");
n = Integer.parseInt(br.readLine());??
Rene Larsen
Ranch Hand

Joined: Oct 12, 2001
Posts: 1179

If the input is like 'n, a_min, a_max' then you have a String that you need to split up first with e.g. a StringTokenizer.
e.g.

Ren´┐Ż


Regards, Rene Larsen
Dropbox Invite
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: about Readline()
 
Similar Threads
input from console
Passing inputstream to a sub class?
getting input from the command line
InputStream to multiple Readers
how to diplay IOStream in struts