![]() |
cin >> in java?
that's my question. i hope this posts, cause it wouldn't the first 2 times i tried
|
I guess your question is "what is the java equivalent of c++'s cin".
There is no direct thing.You need to import java.io and see the classes in them and look for the one which is suitable for your purpose(example: DataInputStream Class) Go through the java documentation for the classes in the package "java.io" |
As psp mentioned you will need to import the java.io
and then something like this will work just fine: BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); then you can use method like readLine() to read in the input: int input; input = Integer.parseInt(br.readLine()); |
| All times are GMT +1. The time now is 09:15 AM. |
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.