Menu
Question Index
...

What will be the output of the following program?

public class Boss {
    static void changToObject(Object obj) {
        Byte b = (Byte) obj;
        System.out.println(b);
    }
    public static void main(String[] args) {
        byte b = (byte) -129;
        System.out.println(b);
        changToObject(b);
    }
}


1
1
127
-129
-129
-129
127
127
Compilation Error or Runtime Error

Doubts

Problems

Topic: Advanced Java Programming Concepts

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App