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.
Loading...
Related Quiz
- Deadlock occurs when two or more threads are blocked forever, each waiting for the other to ________.
- What is the main disadvantage of the Bubble Sort algorithm in terms of performance?
- What is the key difference between the poll() and remove() methods when used with a Queue in Java?
- The keyword ________ is used to skip the rest of the current loop iteration.
- Which of the following primitive data types has the largest size in memory?