Thread: Buffered input?
View Single Post
Old Oct 29th, 2007, 10:53 PM   #2
titaniumdecoy
Expert Programmer
 
titaniumdecoy's Avatar
 
Join Date: Nov 2005
Posts: 855
Rep Power: 3 titaniumdecoy is on a distinguished road
Send a message via AIM to titaniumdecoy
Re: Buffered input?

That is one way to read standard input. A better way is to use a Scanner:

Scanner sc = new Scanner(System.in);
You can use the nextLine() method to read an entire line, or next() to read the next word, as well as a number of other methods such as readInt().
titaniumdecoy is offline   Reply With Quote