#405 Replacing All Occurrences in a String

Companies:
Sberbank
Themes:
JavaJava BasicsPractice

Write a program that replaces every occurrence of the string "abc" with "xyz" in the given text (abc is a string with abc in it):

import java.util.*;
import java.lang.*;
import java.io.*;

class Codechef {
    public static void main (String[] args) throws java.lang.Exception {
        ...
    }
}

Question review

Mentor
Answer as you would in a real interview. I’ll ask follow-up questions, then compare your answer with the reference answer and show your accuracy as a %.
Sign in to start the dialogue The mentor keeps the context of the current question and your previous messages.
Sign in