This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
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 OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP 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()