Class Student completed.

This commit is contained in:
2026-06-10 22:12:23 +03:30
parent 83746b88f6
commit fa3f20a54b
7 changed files with 75 additions and 18 deletions
+7 -18
View File
@@ -40,31 +40,20 @@ public class Student {
@Override
public int hashCode() {
// TODO:
// Return custom hash
// Example:
// return id % 97;
return 0;
return this.getId() % 97;
}
@Override
public boolean equals(Object obj) {
if (obj == null) return false;
if (this == obj) return true;
// TODO:
if (this.getClass() != obj.getClass()) return false;
// Step 1:
// Check null
Student other = (Student) obj;
// Step 2:
// Convert obj to Student
// Step 3:
// Compare IDs
return false;
return this.id == other.id;
}
@Override