好的......我现在这是一个愚蠢的问题,但我正在努力解决这个问题。
public class University {
private List<Student> students;
public University() {
this.student = new ArrayList();
}
public void loadFile(String fileStudents) throws IOException {
BufferedReader readStudents = new BufferedReader(new FileReader(fileStudents));
while(true){
String line = readStudents.readLine();
if( line == null)
break;
String fields[] = line.split(":");
Student e = new Student(Long.parseLong(fields[0]),fields[1], fields[2]);
//System.out.println(e);
students.add(e);
}
}
public List<Student> getStudents() {
return students;
}
public void setStudents(List<Student> students) {
this.students = students;
}
我想创建一个新方法作为参数传递对象&#34; e&#34;。 我想返回e.getNome();