Menu
Question Index
...

What will be the output of the following program?

public class FloatMethods {
    public static void main(String args[]) {
        Integer ge = new Integer("123");
        long l = ge.longValue();
        short s = ge.shortValue();
        String str = Integer.toHexString(ge);
        String str1 = ge.toString();
        System.out.print(l + ", " + s + ", " + str + ", " + str1);
    }
}


123, 123, 7b, 123
123, 12, 6b, 123
123, 12, 7b, 123
Compilation Error or Runtime Error

Doubts

Problems

Topic: Java Number Class

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App