• Post Reply Bookmark Topic Watch Topic
  • New Topic

regarding the input from the user  RSS feed

 
narayana satish
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please tell me how to get input from the user in the single line
like c we will use scanf,in c++ we will use cin. If not so,
what is the use System.in.read.
 
Satya Narayana
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Construct some other convinent Reader from System.in
For example if I want to read data line by line
BufferedReader bin=new BufferedReader(new InputStreamReader(System.in))
Now I can call
String dataRead=bin.readLine();
If you want to read integers, floats then use DataInputStream.
Is it not comfortable to you???
I feel it is very very comfortable than C or C++.
For any doubts, I'm ready to clear.
-SaTyA-
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!