Menu
Question Index
...

What will be the output of the following program?

public class Friend {
    public static void main(String[] args) {
        String quote = "A friend to all is a friend to none";
        System.out.println(quote);
        quote.toUpperCase();
        System.out.println(quote);
        quote.toLowerCase();
        System.out.println(quote);
    }
}


A friend to all is a friend to none
A friend to all is a friend to none
A friend to all is a friend to none
A friend to all is a friend to none
A FRIEND TO ALL IS A FRIEND TO NONE
a friend to all is a friend to none
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