Welcome Guest | Sign in | Register
Interface - Discussion Page For Q.2868 | Java Programming Questions and Answers | Java Programming Free Online-Tests | LucentBlackBoard | LucentBlackBoard.com

Home > Java Programming > Interface > Questions and Answers

Q: interface A {
Void test();
}
Public class Manager implements A{
Public void test(){
System.out.println(“manager”);
}
Public static void main(String args[])
{
Manager m=new Manager();
m.test();
}
}
A. manager B. no output
C. compile time error D. runtime error

Answer and Explanation

Answer:manager

Explanation:
An interface can extend another interface but a class can only implement an interface, so here class Manager implements A, so ans is a)

Comment on this Question

Name:

Loading...




Partner Sites
LucentBlackBoard.com                  SoftLucent.com                  LucentJobs.com
All rights reserved 2012-2015 SoftLucent.