SCJP 1.6版考題 073

出自 陳富國維基館
於 2013年3月30日 (六) 06:23 由 Ikk (對話 | 貢獻) 所做的修訂 (新頁面: 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 ...)
(差異) ←上個修訂 | 最新修訂 (差異) | 下個修訂→ (差異)
前往: 導覽搜尋
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

解說: 實作介面或繼承抽象方法 都要實現其中的抽象方法