Question Index

What will be the output of the following program?

public class JavaComes {
    public static void main(String[] args) {
        String input = "Will java comes?";
        String input1 = input.substring(0, 3);
        input = input.replace('i', 'e');
        input = input.replace("?", "");
        input1.replace('i', 'e');
        input1 = input1.replace('i', 'e') + input.substring(10, 14) + " to " + input.substring(5, 10) + " School";
        System.out.println(input = input1);

Will java comes?
Welcome to java School
Well java comes
Welcome to java School
Will java comes?
Well java comes
Welcome to java  School
Will java comes?
Will java comes?
Some other output
Compilation Error or Runtime Error



Topic: replace() Method In Java

Read this topic
Take test on this topic

Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App