Menu
Question Index
...

What will be the output of following program?

public class ImportantQuestion {
    public static void main(String[] args) {
        Mc mc = new Mc("JAVA");
        System.out.println(Mc.language());
    }
}
final class Mc {
    final String java;
    public Mc(String java) {
        this.java = java;
    }
    public String language() {
        System.out.println(java);
        return java;
    }
}


JAVA
JAVA
java
JAVA
JAVA
Some other output
Compilation Error or Runtime Error

Doubts

Problems

Topic: final Keyword 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