Jump to content
  • Advertisement

Archived

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

fizbanx

cin >> (in java)?

This topic is 5575 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
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
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!