Logo 
Search:

Java Answers

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds
  Question Asked By: Mada Akhtar   on May 10 In Java Category.

  
Question Answered By: Hehet Chalthoum    on May 10

try to :
1. input  '66' and it will display four times.
2. input '567 , it works OK.
3. input '678', it will display five times.
4. input directly enter, it will display twice.

System.in.read() get the row keyboard input, that means it read  the char  of
'enter' too, and 'enter' is composed of 2 chars '\r\n'. you had better to take
java.io.BufferedReader for a substitution.

Share: 

 

This Question has 3 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on Problem with System.in.Read() Or get search suggestion and latest updates.


Tagged: