SCJP 1.6版考題 073
出自 陳富國維基館
10. interface Data { public void load(); } 11. 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 */ } } F. public class Employee extends Info implements Data{ public void Data.load(){ /* do something */ } public void Info.load(){ /* do something */ } }
解答
Ans: A
解說: 實作介面或繼承抽象方法 都要實現其中的抽象方法
|