Which of the following types can you pass as a parameter to the replace()
method on the String class?
D.
There are two signatures for the replace()
method. One takes two char parameters.
The other signature takes a CharSequence.
Both String and StringBuilder implement this interface.
This makes all three alternatives correct, and Option D is correct.