s-day02-HashSet存储自定义对象

This commit is contained in:
2026-08-02 11:53:48 +08:00
parent 648800a600
commit 9f74cb1cae
3 changed files with 38 additions and 4 deletions
@@ -26,4 +26,12 @@ public class Student extends Object {
result = 31 * result + age;
return result;
}
@Override
public String toString() {
return "Student{" +
"name='" + name + '\'' +
", age=" + age +
'}';
}
}