1, mutable and immutable
String class is an immutable class, that is, after the String object is created, the strings in the object cannot be changed before the object is destroyed. StringBuffer and StringBuilder both inherit from the AbstractStringBuilder class. In the AbstractStringBuilder, character arrays are also used to store strings, which are variable classes.
2. Initialization method
When creating a String object, it can be initialized by using the constructor Stringstr = New String ("Java") or directly by using the assignment method String s = "Java ".
3. String modification method
The modification method of String string is to create a StringBuffer, then call the append method of StringBuffer, and finally call the toString () method of StringBuffer to return the result.
4. Is the 4.equals method implemented?
String implements the equals () method and hashCode () method, and the result of new string ("Java "). Equals (new string ("Java")) is true; ;
5. Has the 5.hashCode method been implemented?
StringBuffer does not implement the equals () method and the hashCode () method.
1. Pruning: The trunk height should be reasonably determined according to litchi varieties. For example, for varieties with long branches, the trunk can be