Menu
Question Index
...

What will be the output of the following program?

public class Confusing {
    public Confusing(Object o) {
        System.out.print("-Confusing Object-");
    }
    public Confusing(double[] d) {
        System.out.print("-Confusing Double-");
    }
    public static void main(String[] args) {
        new Confusing(null);
        new Confusing(null);
    }
}


-Confusing Object--Confusing Double-
-Confusing Double--Confusing Object-
-Confusing Object--Confusing Object-
-Confusing Double--Confusing Double-
Some other output
Compilation Error or 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