E:\CSDN\Notes\practice\code\IO>javac StudentInfoTest.java
StudentInfoTest.java:65: 缺少返回语句
}
^
public static Set<Student> getStudents()throws IOException
{
getStudents(null);
}
public static Set<Student> getStudents(Comparator<Student> com)throws IOException
{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
byte[] by=new byte[1024];
String line=null;
Set<Student> stus = null;
if(com==null)
stus=new TreeSet<Student>();
else
stus=new TreeSet<Student>(com);
while((line=br.readLine()) !=null)
{
if("over".equals(line))
break;
String[] info=line.split(",");
Student stu=new Student(info[0],new Integer(info[1]),new Integer(info[2]),new Integer(info[3]));
stus.add(stu);
}
br.close();
return stus;
} |
|