implement Student.java
This commit is contained in:
@@ -41,30 +41,17 @@ public class Student {
|
||||
@Override
|
||||
public int hashCode() {
|
||||
|
||||
// TODO:
|
||||
// Return custom hash
|
||||
|
||||
// Example:
|
||||
// return id % 97;
|
||||
|
||||
return 0;
|
||||
return id % 97;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
|
||||
// TODO:
|
||||
if (this == obj) return true;
|
||||
if (obj == null || getClass() != obj.getClass()) return false;
|
||||
|
||||
// Step 1:
|
||||
// Check null
|
||||
|
||||
// Step 2:
|
||||
// Convert obj to Student
|
||||
|
||||
// Step 3:
|
||||
// Compare IDs
|
||||
|
||||
return false;
|
||||
Student student = (Student)obj;
|
||||
return id == student.id;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
package lecture.multithreading.timeout;
|
||||
|
||||
public class MyRunnable {
|
||||
}
|
||||
Reference in New Issue
Block a user