多做题,通过考试没问题!

Java认证考试

睦霖题库>其他计算机考试>Java认证考试

Given the following interface definition, which definitions are valid?()   interface I {   void setValue(int val);   int getValue();   }    DEFINITION a:   (a) class a extends I {  int value;   void setValue(int val) { value = val;  }   int getValue() {  return value;  }   }   DEFINITION b:   (b) interface b extends I {   void increment();   }   DEFINITION c:   (c) abstract class c implements I {   int getValue() {  return 0;  }  abstract void increment();   }   DEFINITION d:   (d) interface d implements I {  void increment();  }   DEFINITION e:   (e) class e implements I {  int value;   public void setValue(int val) { value = val; }  }  

  • A、Definition a.
  • B、Definition b.
  • C、Definition c.
  • D、Definition d.
  • E、Definition e.
正确答案:B,C
答案解析:
进入题库查看解析

微信扫一扫手机做题