View Single Post
  #3 (permalink)  
Old 03-19-2008, 02:44 PM
Rajesh Rajesh is offline
Member
 
Join Date: Mar 2008
Posts: 3
Rajesh is on a distinguished road
Instead you may try with this simple code to read an integer from console


import java.io.DataInputStream;
public class demo
{
public static void main(String s[])
{
int a;
DataInputStream dis = new DataInputStream(System.in);
a=Integer.parseInt(dis.readLine());
System.out.println(a);
}
}
Reply With Quote