Menu
Question Index
...

What will be the output of the following program?

public class Puzzling {
    public static void main(String[] args) {
        String s = new String("Output Printed");
        System.out.println(s);
    }
}
class String {
    java.lang.String s;
    public String(java.lang.String s) {
        this.s = s;
    }
    public java.lang.String toString() {
        return s;
    }
}


Output Printed
java.lang.String.Output Printed
Some other output
Compilation Error or Runtime Error

Doubts

Problems

Topic: Conclusion (Exploring java.lang)

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App