Menu
Question Index
...

What will be the output of the following program?

public class None {
    void method1(None val1) {
        val1 = null;
    }
    void method2(None val2) {
        val2 = null;
    }
    public static void main(String s[]) {
        None none1 = null;
        None none2 = null;
        new None().method1(none1);
        new None().method2(none2);
        System.out.print(none1 + " ");
        System.out.print(none2);
    }
}


null
null null
(EMPTY)
Some other output
Compilation Error or Runtime Error

Doubts

Problems

Topic: Java Multiple Methods In One Class

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App