View Single Post
  #2 (permalink)  
Old 05-20-2007, 01:28 PM
levent levent is offline
Senior Member
 
Join Date: Dec 2006
Posts: 748
levent is on a distinguished road
You can use a BufferedReader to read a line from the "standard" input stream as follows:

Code:
BufferedReader reader = new BufferedReader(System.in); String input = reader.readLine();
Alternatively, if you are using Java 6 or above, you can use Console class as follows:

Code:
Console console = System.console(); String username = console.readLine("User: ");
Reply With Quote