Vidyalelo
Java Programming · Q56

Strings

Programming · Java Programming · question 56

Q56

Which of the following statement is correct?

A.
replace() method replaces all occurrences of one character in invoking string with another character
Answer
B.
replace() method replaces only first occurrences of a character in invoking string with another character
C.
replace() method replaces all the characters in invoking string with another character
D.
replace() replace() method replaces last occurrence of a character in invoking string with another character

Answer: Option A

Solution

Answer: Option A
No explanation is given for this question Let's Discuss on Board