Java?е?list??set??map???
???????????? ???????[ 2015/5/20 13:41:37 ] ????????????????
????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???????????????????
???????????????????????漰???????????????????SPASVOС??(021-61079698-8054)?????????????????????????
??????
Java???????????Щ???????????????Java????????????????Java?б???Map????????Java Web???????????????Java??????????????д?????Java????????7???????????????????????(java .net ?????)???Java??????????Python??????Java webdriver??λ????????′????е?????Java??д??????????????????Java???????????????JavaScript????????????Java?????????????????? Java???????10??????????????Java?м????????????????java???????ü???????????м???????????????????
???·???
??????????????????
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????????
?????????App Bug???????????????????????Jmeter?????????QC??????APP????????????????app?????е????????jenkins+testng+ant+webdriver??????????????JMeter????HTTP???????Selenium 2.0 WebDriver ??????