Legolas

Legolas

  • NA
  • 81
  • 176.8k

Keyboard Input in Java

Jul 19 2011 5:52 AM
Hi,

  I am using JDK 1.6 and creating a simple program in which I need to accept an integer value from the keyboard. I am using the following code to do it

int a = (int) System.in.read();

It works but when I print the value it is not the same as inserted.

What's the problem ......... ?

Please Reply!!!

Answers (3)