Exception in thread "main" java.lang.Error: Unresolved compilation problem:
The return type is incompatible with TrafficTool.legCount()
at com.imooc.traffic.Ship.legCount(Ship.java:10)
at com.imooc.Demo04.main(Demo04.java:16)
@jerryqueue 说的不对
The return type is incompatible with TrafficTool.legCount()
at com.imooc.traffic.Ship.legCount(Ship.java:10)
at com.imooc.Demo04.main(Demo04.java:16)
@jerryqueue 说的不对
2017-05-29
接口可以继承接口
public interface InterfaceSub extends InterfaceA, interfaceB { }
public interface InterfaceSub extends InterfaceA, interfaceB { }
2017-05-29
" The return type should be the same or a subtype of the return type declared in the original overridden method in the superclass."
2017-05-29
类是抽象的概念,是具有相同属性与方法的对象的集合
类包括属性和方法
Java程序以类class 为组织单元
定义类的步骤:
a 定以类名:public class 类名
b 定以类的属性:属性类型 属性名
c 定义类的方法:方法类型 方法名
类包括属性和方法
Java程序以类class 为组织单元
定义类的步骤:
a 定以类名:public class 类名
b 定以类的属性:属性类型 属性名
c 定义类的方法:方法类型 方法名
2017-05-29