Bookmark Topic Watch Topic
  • New Topic

How to accept integer value from keyboard a

 
Md.Afzalur Rashid
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Report post to moderator
I want to accept integer value from keyboard.But i don't find any method for that(Like scanf()in c and cin>> in c++.I need this because I want to do some project in which all the input will be through keyboard.If any one know how to do that please help me .
 
jason adam
Chicken Farmer ()
Ranch Hand
Posts: 1932
  • Mark post as helpful
  • send pies
  • Report post to moderator
System.in.read() is probably what you are looking for. Check out both the System and InputStream (and OutputStream for good measure)classes in the API for info.
 
Md.Afzalur Rashid
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Report post to moderator
I have tried to use System.in.read().It works fine accept the data but if I am doing any arithmatic operation then it is giving incorrect result.....Can u check it out......
 
jason adam
Chicken Farmer ()
Ranch Hand
Posts: 1932
  • Mark post as helpful
  • send pies
  • Report post to moderator
Closing this thread since you started a new one. I believe your question is answered here.
 
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!