WS 07
This commit is contained in:
@@ -47,6 +47,21 @@ public class StudentLoader extends Thread {
|
||||
// TODO:
|
||||
// add to students list
|
||||
|
||||
String[] data = line.split(",");
|
||||
|
||||
try {
|
||||
int id = Integer.parseInt(data[0]);
|
||||
String name = data[1];
|
||||
String major = data[2];
|
||||
double gpa = Double.parseDouble(data[3]);
|
||||
|
||||
Student student = new Student(id, name, major, gpa);
|
||||
|
||||
students.add(student);
|
||||
}
|
||||
catch (Exception e) {
|
||||
//...
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user