Menu
Question Index
...

What will be the output of the following program?

public class Colours {
    public static void main(String args[]) {
        int pink = 'p';
        int blue = 'B';
        String red = Integer.toBinaryString(pink);
        String green = Integer.toOctalString(blue);
        System.out.print(red + " " + green);
    }
}


1111000 66
1110000 66
1110000 102
1111000 102
Compilation Error or Runtime Error

Doubts

Problems

Topic: Converting Numbers to and from Strings 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