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

Home > Java Programming > Interface > Questions and Answers

Q: Interface A {
Void test1();
}
Interface B {
Void test2();
}
Class C implements B {
Public void test1(){
System.out.println(“test1”); }
Public void test2(){
System.out.println(“test2”);
} }
Class Manager{
Public static void main(String args[]){
C c1=new C();
c1.test1();
c1.test2();
} }
A. test1 test2 B. test2 test1
C. compile time error D. runtime error

Answer and Explanation

Answer:test1 test2

Explanation:
An interface can extend another interface but a class can only implement an interface, so here class C implement B, so ans is a)

Comment on this Question

Name:

Loading...




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