- If you wish to modify a string, the String class is not appropriate. You have to use the StringBuilder class.
Enter this sequence of instructions:
- Add some instructions which use String to compare memory diagrams. Check that the option Simplified String display is not selected and that Inherited attributes is selected.
- Write a call to the reverse() function which reverse the characters of sb2, store the result in a new variable. Is a new object created? How to know?
- Call the deleteCharAt() transformation function which can delete a character at a specified position of sb2. What do you notice?