如下哪个语句是正确的?
    
a. A subclass inherits all methods (including the constructor) from the superclass.
b. A class can implements as many interfaces as needed.
c. In Java single inheritance is allowed,which makes code more reliable.
c. When a class implements an interface, it can define as ,many methods of the interface as needed b 和 c 这道题也不知道是在考什么? 反正就是知道 b 和 c  是对的.

解决方案 »

  1.   

    1.子类里边有父类里边的所有的方法,包括构造方法
    2.类可以根据需要实现多个接口
    3.java允许单继承,这样类更可靠
    4.当类实现接口后,可以根据需要实现里边的方法1.不能有构造函数
    2.正确
    3.正确
    4.必须全部实现
      

  2.   

    考的是继承和实现接口的问题,即在Java中是单线继承的,一个类只能继承一个父类(single inheritance ),但是可以实现多个接口(implements as many interfaces as needed)。