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();
        pv.new Print().value();
    }
    class Print {
        int x = 15;
        void value() {
            System.out.println(x + z);
        }
    }
}


(EMPTY)
114.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