??????????????????
????????????? ??Java?У? String???????????????????????????????? ????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
????????????????????
????????Java?????? ????String????????????????????????????
????String s = "ABCabc";
????System.out.println("s = " + s);
????s = "123456";
????System.out.println("s = " + s);
?????????????
????s = ABCabc
????s = 123456
??????????????String????s???????s????“ABCabc”?? ???????s????“123456”?? ????????????????s????????????????????String?????????????? ??????????????????? s??????String?????????????????????????????????????????????????????????????????????????????????4????????????????????????????????????????????????????
??????????s???????????????????????????????s=“123456”; ????????й???????????????μ????“123456”?? ??????s??????????????????????????“ABCabc”????????д????????и????????????????

????Java??C++????????????? ??Java?в?????????????????????е?????????????????????????????ò????????????????????????????????????????????????????????????????C++?д?????????????????????????????????????????????????????Java?е????ú?C++?е??????????????????????????????????????е???????????Java?У??????????????????????Java?е????ò?????C++?е???????????м??????
???????String????????????
????????String?????????????????String???ж?????Щ????????? ??JDK1.6?У?String???????????????????
????public final class String
????implements java.io.Serializable?? Comparable<String>?? CharSequence
????{
????/** The value is used for character storage. */
????private final char value[];
????/** The offset is the first index of the storage that is used. */
????private final int offset;
????/** The count is the number of characters in the String. */
????private final int count;
????/** Cache the hash code for the string */
????private int hash; // Default to 0
??????JDK1.7?У?String???????Щ??????????????substring??????????????????????????????JDK1.7??String????????????????????????
????public final class String 
????implements java.io.Serializable?? Comparable<String>?? CharSequence { 
????/** The value is used for character storage. */ 
????private final char value[]; 
????/** Cache the hash code for the string */ 
????private int hash; // Default to 0
?????????????????????? ??Java??String?????????????????????JDK6?У? value??String????????飬offset??String?????value?????е????λ???count??String?????????????????JDK7?У???????value?????????value?е????????????????String?????????????????????????? ????????????hash????????????String????????????棬???????????????????????????Java?У???????????????ο???????????java?????????????? ????value?????????????????????????????????????????String s = “ABCabc”; ?????????????????沼??????????????

????value??offset??count??????????????private????????????setValue?? setOffset??setCount????????????????Щ?????????String???????????String?????????????????????? ??????String???????????????????????????value??offset??count??????????????final??? ??????String????????????????????????? ???????????????????String??????????????
?????????String?У??????????Щ?????????????????????????????Щ????????substring?? replace?? replaceAll?? toLowerCase??????????′???
????String a = "ABCabc"; 
????System.out.println("a = " + a); 
????a = a.replace('A'?? 'a'); 
????System.out.println("a = " + a);
?????????????
????a = ABCabc
????a = aBCabc