Menu
Question Index
...

What will be the output of following program?

public class Replace {
    public static void main(String args[]) {
        String str = "This replace method of String will return a new String object if there is a replace.";
        String replacestr = str.replace('r', 's');
        System.out.println(replacestr);
    }
}


This seplace method of Stsing will setusn
a new Stsing object if these is a seplace.
This seplace method of String will return
a new String object if there is a replace.
This replace method of String will return
a new String object if there is a seplace.
Compilation Error or Runtime Error

Doubts

Problems

Topic: replace() Method In Java

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App