Menu
Question Index
...

What will be the output of the following program?

public class Upper {
    public static void main(String args[]) {
        char[] low = {'a', 'B', 'C', 'e', 49};
        char h1 = Character.toUpperCase(low[0]);
        char h2 = Character.toUpperCase(low[1]);
        char h3 = Character.toUpperCase(low[2]);
        char h4 = Character.toUpperCase(low[3]);
        char h5 = Character.toUpperCase(low[4]);
        System.out.print(h1 + ", " + h2 + ", " + h3 + ", " + h4 + ", " + h5);
    }
}


A, B, C, E, 1
A, B, C, E, 49
Compilation Error
Runtime Error

Doubts

Problems

Topic: Java Character Class

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App