The method replace(oldChar, newChar) belongs to the ________ class in Java.

  • Character
  • String
  • StringBuilder
  • StringManipulator
The replace(oldChar, newChar) method in Java belongs to the String class. This method is used to replace all occurrences of oldChar with newChar in a given string. The other classes listed do not have this specific method.
Add your answer
Loading...

Leave a comment

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