java??list??set??map ??????
???????????? ???????[ 2014/9/16 17:04:39 ] ??????????????? Java
????List??????????????????????????????????Set????????????????Σ????????????????????(?????????????????????????Set?????????????????–??????????List)??Map???????????????????????????”??”???Map??????????????????????????????????????????????????????????? LinkedHashSet????LinkedHashMap. List????????
???????????????List: ??????????ArrayList??????????????????????????????????LinkedList???????????????????????????????????????????????
????List : ??????List???????????????????????????List?Collection????????????????????List?м????????????(??????LinkedList??á?)???List????????ListIterator???????????????????????List????????List?м????????????
????ArrayList : ??????????List????????????п?????????????????List?м?????????????????????ListIterator??????????????????ArrayList??????????????????????????????LinkedList?????????
????LinkedList : ????????????????????List?м?????????????????????????????????????(???ArrayList???檔)?????????з?????addFirst()?? addLast()?? getFirst()?? getLast()?? removeFirst() ?? removeLast()?? ??Щ???? (??????κν???????ж????)???LinkedList???????????????к?????????á?
????Set????????
????Set??????Collection??????????????????κζ??????????????????????????List???????Set??Collection?????????????(??????????????????????????????????)Set??????????????(????????ж???????????????)
????Set : ????Set????????????????????Set?????????????????Set??????????equals()?????????????????Set??Collection?????????????Set?????????????????
????HashSet : ????????????Set??????HashSet??????????hashCode()??
????TreeSet : ????????Set?? ????????????????????Set?????????????С?
????LinkedHashSet : ????HashSet??????????????????????????????(????????)????????????????????Set???????????????????????
????Map????????
????????put(Object key?? Object value)??????“?”(????????)????“?”???????“??”(key)(???????????)??????get(Object key)?????????“??”???????“?”????????containsKey()??containsValue()????Map???????????“??”??“?”???????Java????а????????????Map??HashMap?? TreeMap?? LinkedHashMap?? WeakHashMap?? IdentityHashMap????????????????????Map???????????Ч?????????????????????????????ж?“??”????????????????
???????Ч????Map???????????????get()?????Щ?£????????????ArrayList??????“??”?????????????????HashMap???????????HashMap????????????????“?????”(hash code)?????????????????????“?????”??“???”???????????int???????????????????Щ??????????????????????Java?????????????????hashCode()??????????Object?е??????
????HashMap?????????hashCode()???п????????????????????????????
????Map : ???“?????”?????????????????“??”????“?”
????HashMap : Map??????б?????????????“?????”?????????????????????????????????capacity?????????load factor??????????????????
????LinkedHashMap : ??????HashMap?????????????????????“?????”???????????????????????????(LRU)????????HashMap???????????????????????????????????????????????
????TreeMap : ?????????????????????“??”??“?????”????????????(??????Comparabel??Comparator????)??TreeMap?????????????????????????????TreeMap??????subMap()??????Map????????????????????
????WeakHashMao : ????(weak key)Map??Map???????????????????: ???????????????????????????map??????????????“??”?????“??”???????????????????
????IdentifyHashMap : ???==????equals()??“??”??????hash map????????????????????
??????
?????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11