Menu
Question Index
...

What will be the output of the following program?

public class Conversion {
    public static void main(String arg[]) {
        int input = 10;
        convertToDifferentBase(input);
    }
    private static void convertToDifferentBase(int input) {
        String s = "" + Integer.toBinary(input);
        String y = "" + Integer.toHex(input);
        System.out.println(s + " " + y);
    }
}


1000 b
1010 a
Some other output
Compilation Error or Runtime Error

Doubts

Problems

Topic: Methods Of Integer, Long Classes 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