Menu
Question Index
...

What will be the output of the following program?

public class DemoOnClasses {
    public static void main(String[] args) {
        DemoOnClasses object = new DemoOnClasses();
        String value = object.__();
        System.out.print(value);
    }
    String __() {
        return "meritCampus";
    }
}


(No Ouptut)
meritCampus
Compilation Error because of the method name is not a valid Java identifier
Compilation Error or Runtime Error for some other reason

Doubts

Problems

Topic: Unknown

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App