Menu
Topics Index
...
`

creating multiple Interface


If you need explanation Read this topic

If you need Answer Take test on this topic

creating multiple Interface
What will be the output of the following program?
interface MyFirstInterface {
    void output();
}
interface MySecondInterface extends MyFirstInterface {
    void output();
}
public class DemoOnInterface implements MySecondInterface {
    public void output() {
        System.out.println("Programming competattion on Meritcampus... Hurry up");
    }
    public static void main(String args[]) {
        DemoOnInterface demoOnInterface = new DemoOnInterface();
        demoOnInterface.output();
    }
}

A. Programming competattion in Meritcampus... Hurry up
B. (EMPTY)
C. Some other output
D. Compilation Error or Runtime Error
Topic: Java Interface

If you need explanation Read this topic

If you need Answer Take test on this topic

User comments below. All of them might not be correct.

ans a.
output() cald n prints sop

Posted by Maheshwari Natarajan    2014-07-21 12:54:21


ans A, demoOnInterface object calls the class  DemoOnInterface  reference and prints output..,

Posted by Damu Surya    2014-07-21 12:57:55


Answer a.
output() instanc method is calld.
hre 2 intrfac r thr methods of the intrfac defind without body.
demooninfac clas method gets printdmed

Posted by NagaRaj Nataraj    2014-07-21 13:00:40


a

Posted by Zeg Abder    2014-07-21 14:00:40


ans is a

Posted by Vino Krishnan    2014-07-21 14:56:02


ans:A

Posted by Samyuktha Reddy    2014-07-21 15:11:00


Congratulations Maheshwari Natarajan. You are this dose winner. We will send you the link using which you can claim your recharge.

Posted by Merit Campus    2014-07-22 04:27:49


© meritcampus 2019

All Rights Reserved.

Open In App