chipdouglas
03-15-2003, 11:20 PM
that's my question. i hope this posts, cause it wouldn't the first 2 times i tried
|
||||
cin >> in java?chipdouglas 03-15-2003, 11:20 PM that's my question. i hope this posts, cause it wouldn't the first 2 times i tried psp 03-17-2003, 04:33 AM 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" Spookster 03-17-2003, 07:40 PM 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()); |
| |||
EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum