-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStudentDB.java
More file actions
25 lines (20 loc) · 1.14 KB
/
Copy pathStudentDB.java
File metadata and controls
25 lines (20 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package data;
import java.util.Arrays;
import java.util.List;
import java.util.Optional;
public class StudentDB {
public static List<Student> getAllStudents() {
Subject sub=new Subject();
sub.setName("testsub");
Optional<Subject> val=Optional.ofNullable(sub);
Student student1 = new Student("Adam", 2, 4.0, "male", 10,Arrays.asList("swimming", "basketball", "volleyball"),98,97);
Student student2 = new Student("Jenny", 2, 3.8, "female", 11,Arrays.asList("swimming", "gymnastics", "soccer"),77,78);
Student student3 = new Student("Emily", 3, 4.0, "female", 12,Arrays.asList("swimming", "gymnastics", "aerobics"),98,11);
Student student4 = new Student("Dave", 3, 4.0, "male", 15, Arrays.asList("swimming", "gymnastics", "soccer"),56,78);
Student student5 = new Student("Sophia", 4, 3.5, "female", 10,Arrays.asList("swimming", "dancing", "football"),89,92);
Student student6 = new Student("James", 4, 3.9, "male", 22,Arrays.asList("swimming", "basketball", "baseball", "football"),44,88);
student1.setSubject(val);
List<Student> students = Arrays.asList(student1, student2, student3, student4, student5, student6);
return students;
}
}