Menu
Question Index
...

What will be the output of the following program?

class Visit {
    public void f1(Object o1) {
        System.out.println("Visited Object");
    }
    public void f1(String s) {
        System.out.println("Visited String");
    }
    public static void main(String[] args) {
        new Visit().f1(null);
        new Visit().f1(new Object());
        new Visit().f1(new String());
    }
}


Visited Object
Visited Object
Visited String
Visited String
Visited Object
Visited Object
Visited String
Visited Object
Visited String
Some other output
Compilation Error or Runtime Error

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