摘要: 使用HashMap,如果key是自定义的类,就必须重写hashcode()和equals() hashcode()和equals()都继承于object,在Object类中的定义为: equals()方法在Object类中的定义: public boolean equals(Object obj){ 阅读全文
posted @ 2018-12-26 10:38 zsq_fengchen 阅读(5293) 评论(1) 推荐(1) 编辑