Welcome Guest | Sign in | Register
Interface - Discussion Page For Q.2867 | 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 extends 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:compile time error

Explanation:
An interface can extend another interface but a class can only implement an interface, so here class Manager extends A, this is not correct so ans is c)

Comment on this Question

Name:

Loading...




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