Menu
Question Index
...

What will be the output of the following program?

public class ByteDemo {
    public static void main(String[] args) {
        Byte bt = new Byte((byte) 'A');
        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: 65 is 95
Primitive byte value of Byte object: 65 is 65
Primitive byte value of Byte object: 33 is 65
Primitive byte value of Byte object: 65 is 21
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