Menu
Question Index
...

What will be the output of the following program?

public class Lovely {
    public static void main(String... args) {
        String a = "TATTARRATTAT";
        String b = a.toLowerCase();
        b.replace('a', 'o');
        b.replace('t', 'o');
        b.replace('r', 'o');
        System.out.println(b);
        System.out.println(b.replace('o', 'a'));
    }
}


tattarrattat
tattarrattat
oooooooooooo
aaaaaaaaaaaa
tattarrattat
tottorrottot
Compilation Error
Runtime Error

Doubts

Problems

Topic: toLowerCase() And toUpperCase() Methods 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