Menu
Question Index
...

What will be the output of the following program?

public class Subjects {
    public static void main(String[] args) {
        char english = 9;
        char hindi = 49;
        char maths = 'M';
        char science = '8';
        boolean e = Character.isDigit(english);
        boolean h = Character.isDigit(hindi);
        boolean m = Character.isDigit(maths);
        boolean s = Character.isDigit(science);
        System.out.print(e + ", " + h + ", " + m + ", " + s);
    }
}


false, false, true, true
true, true, false, false
false, true, false, true
Compilation Error or 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