Menu
Question Index
...

What will be the output of following program?

public class EcoGreen {
    EcoGreen get() {
        return this;
    }
    public static void main(String[] args) {
        new Green().get().message();
    }
}
class Green extends EcoGreen {
    Green get() {
        return this;
    }
    void message() {
        System.out.print("www.facebook.com/java.meritcampus");
    }
}


www.facebook.com/java.meritcampus
www.facebook.com/java.meritcampus
www.facebook.com/java.meritcampus
Some other output
Output can not be determined
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