Menu
Question Index
...

What will be the output of the following program?

public class Colourful {
    public static void main(String[] args) {
        if ("MeritCampus ".trim() == "MeritCampus".trim()) {
            System.out.println("Equal");
        } else {
            System.out.println("Not Equal");
        }
    }
}


Equal
Not Equal
Compilation Error
Runtime Error

Doubts

Problems

Topic: Java String trim() Method - trim() 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