WS 07
This commit is contained in:
@@ -45,9 +45,7 @@ public class Student {
|
||||
// Return custom hash
|
||||
|
||||
// Example:
|
||||
// return id % 97;
|
||||
|
||||
return 0;
|
||||
return id % 97;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -64,7 +62,11 @@ public class Student {
|
||||
// Step 3:
|
||||
// Compare IDs
|
||||
|
||||
return false;
|
||||
if (obj == this) return true;
|
||||
if (obj == null || obj.getClass() != getClass()) return false;
|
||||
|
||||
Student student = (Student) obj;
|
||||
return student.getId() == id;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user