Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Input data  RSS feed

 
Mike Sh
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello
I know C++ in the language I can input data by using cin >> x;
How can I do this in Java?
Thanks
 
Albert Kam
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
umm, there are many ways to do this kind of stuff.
i'll give one example : (import the java.io.*)
BufferedReader in =
new BufferedReader(new InputStreamReader(System.in));
String input = in.readLine();
eh, i think i got a kind of de javu
hope that helps
cyao !
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!