Menu
Question Index
...

What will be the output of the following program?

public class ByteConversion {
    public static void main(String[] args) {
        Byte bt = new Byte("-129");
        byte b = bt.byteValue();
        String str = "Primitive byte value of Byte object: " + bt + " " + "is" + " " + b;
        System.out.print(str);
    }
}


Primitive byte value of Byte object: -129 is -129
Primitive byte value of Byte object: -129 is -127
Some other output
Compilation Error or 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