This commit is contained in:
Arefe Talebi
2026-07-16 17:20:32 +03:30
parent 83746b88f6
commit 3713f08085
12 changed files with 122 additions and 86 deletions
+16 -1
View File
@@ -18,6 +18,8 @@ public class StudentManager {
// Hint:
// addAll()
students.addAll(newStudents);
}
public Student searchStudent(int id) {
@@ -28,6 +30,12 @@ public class StudentManager {
// Compare IDs
for (Student student : students) {
if (student.getId() == id) {
return student;
}
}
return null;
}
@@ -39,6 +47,13 @@ public class StudentManager {
// Remove student
for (Student student : students) {
if (student.getId() == id) {
students.remove(student);
return true;
}
}
return false;
}
@@ -52,4 +67,4 @@ public class StudentManager {
}
}
}