Menu
Question Index
...

What will be the output of the following program?

public class PrintZValue {
    double z = 'c';
    public static void main(String[] args) {
        PrintZValue pv = new PrintZValue();
        Print print = new Print();
        pv.print.value();
    }
    public class Print {
        int x = 15;
        void value() {
            System.out.print("Output ");
            System.out.print(x + z);
        }
    }
}


Output 114.0
Output 1599.0
Compilation Error
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