???????????????????10??Java?????????????????Java???????????????????Java????????????????
????1????α??????????????”==”????equals()??
????????????”==”??????????????????????????equals()?????????????????????????????????”==”??????п?????false??????equals()??????true?????????????????????new?????????????????????????????????equals()??
????2??????Щ?????е???????????char[]?洢?????String??
????String????????????ζ??????????????????????????У??????????????????????????????????洢??????????????????????е?????????????鷽????????????п???????????????κε????
????3??????????????????switch???
????JAVA 7??????汾?????????JDK 7?У?????????????????switch????????????jdk 6?????汾??????????????
????// java 7 only!
????switch (str.toLowerCase()) {
????case "a":
????value = 1;
????break;
????case "b":
????value = 2;
????break;
????}
????4????ν???????????????int?????
????int n = Integer.parseInt("10");
??????????????????????????????????
????5????????????????????????
?????????????????????????????????????”s”???????????????” “?? “ ”?? “ ”?? “ ”
????String[] strArray = aString.split("\s+");
????6??substring()??????????????
??????jdk 6?У?substring()?????????????????????????????????????????д???????μ?String???????????????μ???????飬???????substring()?????????????????????
????str.substring(m?? n) + ""
????????????????μ?String???????????????????????????????????????????????????????????????????????????????????????????
????7??String??StringBuilder??StringBuffer????????
????String??StringBuilder??StringBuilder????????????StringBuilder??????????????????????????StringBuilder??StringBuffer??StringBuffer???????????????????thread-safe???????Ч?????StringBuilder????
????8??????????????????
??????Python?У??????????????????????????????????????????????????Java?У??????????StringUtils??repeat()??????????StringUtils??Apache????????????????????????
????String str = "abcd";
????String repeated = StringUtils.repeat(str??3);
????//abcdabcdabcd
????9????ν????????????????????
?????????????·????????????????£?
????String str = "Sep 17?? 2013";
????Date date = new SimpleDateFormat("MMMM d?? yy"?? Locale.ENGLISH).parse(str);
????System.out.println(date);
????//Tue Sep 17 00:00:00 EDT 2013
????10??????????????????????г???????
?????????????????Apache??????????е?StringUtils?????????£?
????int n = StringUtils.countMatches("11112222"?? "1");
????System.out.println(n);
??????????10??????Java??????????????????????????????????????Щ??????Java??????????????????и???????????????????????