????1.2  Set(????)
????Set?????????????????е??????????????????????????????? Set????????????????????
????HashSet?? HashSet??????????????????е?????????????
????TreeSet ??TreeSet???????SortedSet?????????????е???????????
????Set ???÷????????????????????????????
????Set set=new HashSet();
????String s1=new String("hello");
????String s2=s1;
????String s3=new String("world");
????set.add(s1);
????set.add(s2);
????set.add(s3);
????System.out.println(set.size());//????????ж??????? ? 2??
????Set ?? add()??????????ж???????????????????У?
????boolean isExists=false;
????Iterator iterator=set.iterator();
????while(it.hasNext())           {
????String oldStr=it.next();
????if(newStr.equals(oldStr)){
????isExists=true;
????}
????}
????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???????????????????????
????1.3  List(?б?)
????List??????????????????????洢???????п????????????
????List???????????????????ο????£?ArrayList??LinkedList??????
????ArrayList() : ????????????????顣??????????????????????ArrayList()?в???????????????????
????LinkedList(): ??????в?????????????????????????????????????
????????List??????????????????????????λ?????λ??????? List ?? get(int index) ?????????????????index?????????λ???????±??“0” ???????????????????????е????ж?????????
????1?? for?????get()??????
????for(int i=0; i<list.size();i++){
????System.out.println(list.get(i));
????}
????2?? ??? ????????Iterator??:
????Iterator it=list.iterator();
????while(it.hashNext()){
????System.out.println(it.next());
????}
????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???????????????к?????????á?
????1.4 Map(???)
????Map ??????????????????????????????????????????????????????? Map??м????Collection??? ??Map?????м??????????????????????????????????
????Map ????÷?????
????1 ?????????????
????Object put(Object key?? Object value)?? ?????м??????
????Object remove(Object key)?? ?????KEY???????
????void putAll(Map t)??  ?????????????????????????????
????void clear()???????????????????
????2 ?????????
????Object get(Object key)???????????key????? ??Map?????е????????????????????????????????????equals()??????????????false.?????????????????????????????????????
????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???????????????????