单选题
发布日期:2021-05-17
The equals method does NOT properly override the Object.equals method.
Compilation fails because the private attribute p.name cannot be accessed in line 5.
To work correctly with hash-based data structures, this class must also implement the hashCode method.
When adding Person objects to a java.util.Set collection, the equals method in line 4 will prevent duplicates.
标签: "暂无标签"
题王网让考试变得更简单
扫码关注题王,更多免费功能准备上线!
此试题出现在