Not!<br>
The readInt() always reads four bytes (32 bit). If you type<br>
1234, the result will be $31*65536+$32*256+$33*16+$34 (ASCII code*2^...), and not 1234. The readInt() is suitable only DataInputStream-s (and descendants).<br>
<br>
Bye, Otto.<br>
HI,<br>
Why not to read a line from the keyboard<br>
<br>
BufferedReader br = new BufferedReader( new InputStreamReader( System.in));<br>
String str = br.readLine() ;<br>
<br>
and then <br>
<br>
int value = Integer.parseInt( str ) ;<br>
<br>
Hope it will help<br>
<br>
Regards.<br>
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.