"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 ...)
 
(無差異)

於 2013年3月30日 (六) 06:23 的最新修訂

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

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