Home / CSE MCQs / JAVA MCQs :: Discussion

Discussion :: JAVA MCQs

  1. Which of the following statement is correct?
  2. A.
    replace() method replaces all occurrences of one character in invoking string with another character.
    B.
    replace() method replaces only first occurances 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.

    View Answer

    Workspace

    Answer : Option A

    Explanation :

    replace() method replaces all occurrences of one character in invoking string with another character.


Be The First To Comment