Menu
Question Index
...

What will be the output of the following program?

public class MarksFormats {
    public static void main(String[] args) {
        int marks = 90;
        String stringFormat = Integer.toHexString(marks);
        int numberFormat = Integer.parseInt(stringFormat);
        System.out.println(numberFormat);
    }
}


59
90
Runtime Error because of java.lang.NumberFormatException
Compilation Error or Runtime Error for some other reason

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