Which class should be used when a string is going to be modified frequently?

  • StringArray
  • StringBuffer
  • StringBuilder
  • StringModifier
When a string is going to be modified frequently in Java, the StringBuilder class should be used. This class provides a mutable sequence of characters and is more efficient for string manipulation operations compared to String or StringBuffer. The other options, StringBuffer, StringArray, and StringModifier, are not standard Java classes for string manipulation.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *