• Advertisement

Archived

This topic is now archived and is closed to further replies.

cin >> (in java)?

This topic is 5459 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Advertisement
BufferedReader stdin = new BufferedReader(new InputStreamReader( System.in ) );

stdin.readLine();


[edited by - Programmer One on March 15, 2003 6:37:44 PM]

Share this post


Link to post
Share on other sites
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){}
}
}





Share this post


Link to post
Share on other sites
thanks a lot! I''d been trying various combinations of the above code, but not in the right order....

Share this post


Link to post
Share on other sites

  • Advertisement