The setLength method, which allows altering the length of the character sequence stored in the object, is a method of ________.

  • CharArray
  • String
  • StringBuffer
  • StringBuilder
The setLength method is a method of the StringBuffer class in Java. It allows you to alter the length of the character sequence stored in the StringBuffer object. The other options are not related to the setLength method.
Add your answer
Loading...

Leave a comment

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