This commit is contained in:
2026-05-27 21:01:44 -07:00
parent 83746b88f6
commit d9bc9d8eb9
5 changed files with 59 additions and 60 deletions
+11 -14
View File
@@ -41,30 +41,27 @@ public class Student {
@Override
public int hashCode() {
// TODO:
// Return custom hash
return id % 97;
// Example:
// return id % 97;
return 0;
}
@Override
public boolean equals(Object obj) {
// TODO:
if(obj == null){
return false;
}
// Step 1:
// Check null
Student std = (Student) obj;
// Step 2:
// Convert obj to Student
if(std.hashCode() == this.hashCode()){
return true;
}
else {
return false;
}
// Step 3:
// Compare IDs
return false;
}
@Override