Menu
Question Index
...

What will be the output of the following program?

public class OutputIs {
    public static void main(String[] args) {
        HelloWorld hw = new HelloWorld();
        hw.Helloworld();
        hw.HelloWorld();
        System.out.println(((int) (char) (byte) 56));
    }
}
class HelloWorld {
    public void Helloworld() {
        System.out.println(((char) (byte) 56));
    }
    public void HelloWorld() {
        System.out.println(((int) (byte) 56));
    }
}
class string {
    string() {
        System.out.println(((double) (char) (byte) 56));
    }
}


8
-1
65535
?
56
56
8
-1
65535
65535.0
?
56
56
56.0
Some other output
Compilation Error or Runtime Error

Doubts

Problems

Topic: Calling A Class From Another Class 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