本帖最后由 一步步 于 2013-11-14 10:42 编辑
public static Set<Student>getStudent()throws IOException
{
BufferedReader bufr=new BufferedReader(new InputStreamReader(System.in));
String line=null;
Set<Student>stus=new TreeSet<Student>();
while((line=bufr.readLine())!=null)
{
if("over".equals(line))
break;
String[] info=line.split(",");
Student stu=new Student(info[0]),Integer.parseInt(info[1]),Integer.parseInt(info[2]),Integer.parseInt(info[3]));
stus.add(stu);
}
bufr.close();
return stus;
这段代码中Student stu=new Student(info[0]),Integer.parseInt(info[1]),Integer.parseInt(info[2]),Integer.parseInt(info[3]));这行语句提示:
Multiple markers at this line - Integer cannot be resolved or is not a field - Syntax error on token ",", . expected - Syntax error on token ",", ; expected - Syntax error on token ",", . expected - Syntax error on token ")", delete this token - The constructor Student(String) is undefined这样的错误是怎么回事啊?
|
|