Advertisement

cin >> (in java)?

Started by March 15, 2003 05:26 PM
2 comments, last by fizbanx 21 years, 8 months ago
anyone?
BufferedReader stdin = new BufferedReader(new InputStreamReader( System.in ) );

stdin.readLine();


[edited by - Programmer One on March 15, 2003 6:37:44 PM]
Advertisement
I think this is what you are looking for, I hope it helps.


  import java.io.*;public class inputTest{   public static void main(String args[])   {      BufferedReader console =          new BufferedReader(new InputStreamReader(System.in));            try      {         // This is you would read a string from the console         String str = console.readLine();      }            catch(IOException e){}   }}  





thanks a lot! I''d been trying various combinations of the above code, but not in the right order....

This topic is closed to new replies.

Advertisement