得到键盘输入字符问题
请问一下应该怎么实现得到键盘输入字符
我用system.in.read()得到的是一个INT数据
我需要得到STRING型,然后写入数组
String[][][] person = new String[10][3][1];
for (int i = 0; i <= 9; i++)
{
System.out.println( "enter the student name: ");
String a = System.in.read(); //这里出错
for (int j = 0; j <= 2; j++)
{
for (int k = 0; k < 1; k++)
{
}
}
}
------解决方案-------------------- InputStreamReader in =new InputStreamReader(System.in);
BufferedReader buffin=new BufferedReader(in);
String strIn = " ";
try{
strIn=buffin.readLine();
}
catch(
IOException e)
{
System.out.println(e.toString());
}