摘要: 分析: String s="hello";s+="world"; 引用变量s 一开始指向String对象("hello" :0x001); ("world":0x002); s拼接后,就重新指向String对象("helloworld":0x003); 答:s改变了,原始的String对象 "hel 阅读全文
posted @ 2017-08-12 22:29 scwyfy 阅读(1000) 评论(0) 推荐(0) 编辑
摘要: HashSet: 重写 hashCode和equals方法 特点:无序,唯一 底层结构是: 哈希表:元素为链表的数组。综合了链表和数组的好处 add方法:底层实际是依赖于HashCode()和equals()方法 HashSet实际用的是HashMap public HashSet() { map 阅读全文
posted @ 2017-08-12 21:25 scwyfy 阅读(514) 评论(0) 推荐(0) 编辑