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

Home > Java Programming > Abstract > Questions and Answers

Q: interface Data { public void load(); }
abstract class Info { public abstract void load(); }


Which class correctly uses the Data interface and Info class?
A. public class Employee extends Info implements Data {
 public void load() {
/*do something*/ 
}
}
B. public class Employee implements Info extends Data {
public void load() { 
/*do something*/
}
}
C.
public class Employee extends Info implements {
Data public void load(){
/*do something*/
}
public void Info.load(){
/*do something*/
}
}
D. public class Employee implements Info extends Data {
public void Data.load(){
 /*do something*/ 
}
public void load(){
 /*do something*/ 
}
}
E. public class Employee implements Info extends Data {
 public void load(){ 
/*do something*/ 
}
public void Info.load(){
 /*do something*/ 
}
}

Answer and Explanation

Answer:public class Employee extends Info implements Data {

 public void load() {
/*do something*/ 
}
}

Explanation:
whenever you want to use interface then use implements keyword, and during abstract class use extends keyword. Vice versa is not true.

Comment on this Question

Name:

Loading...




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