高手帮帮忙!
在JAVA中输入一个数字好像很麻烦,下面的程序只能输入的变量a
但是要想连续或者循环输入一批数字的话要怎么实现!
public static void main(String[] args)throws IOException
{
InputStreamReader reader=new InputStreamReader(System.in);
BufferedReader input=new BufferedReader(reader);
System.out.print("enter your name");
String text=input.readLine();
int a=new Integer(text).intValue();
System.out.println(a);
}