implement Student.java

This commit is contained in:
2026-05-25 21:18:39 +03:30
parent 83746b88f6
commit a7d2373bad
2 changed files with 9 additions and 18 deletions
+5 -18
View File
@@ -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 {
}