Menu
Question Index
...

What will be the output of the following program?

public class Coins {
    public static void main(String[] args) {
        String input = "50";
        Short coins = Short.parseShort(input + 10);
        short total = Short.parseShort(input, 16);
        System.out.println(coins + " " + total);
    }
}


5010 80
60 96
Compilation Error
Runtime Error

Doubts

Problems

Topic: Creating Objects for Primitive Data Types (Byte, Short)

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App