文件名称:src
介绍说明--下载内容均来自于网络,请自行研究使用
面向对象编程基础编写一个交通工具的父类(Transport):
(1) 属性包括速度、载重量:
(2) 方法包括构造方法和显示属性的方法。
(3) 定义Transport的子类Vehicle,Vehicle有自己新增的属性:车轮数、车牌号;定义对新增的属性进行显示的方法。
(4) 定义Transport的子类Airplane,Airplane有自己新增的属性:发动机类型、座位数;定义对新增的属性进行显示的方法。
(5) 在测试类的main()方法中分别创建Vehicle和Airplane的对象,调用显示属性的方法。
-Based on object-oriented programming to write a parent class of transport (Transport): (1) property, including speed, load capacity: (2) method and display properties include the constructor method. (3) defines a subclass of Transport Vehicle, Vehicle has its own new properties: the number of wheels, license plate number defined attributes of the new display method. (4) defines a subclass of Transport Airplane, Airplane has its own new properties: the engine type, number of seats defined attributes of the new display method. (5) in the test class main () method to create Vehicle and Airplane were the object, call the display properties.
(1) 属性包括速度、载重量:
(2) 方法包括构造方法和显示属性的方法。
(3) 定义Transport的子类Vehicle,Vehicle有自己新增的属性:车轮数、车牌号;定义对新增的属性进行显示的方法。
(4) 定义Transport的子类Airplane,Airplane有自己新增的属性:发动机类型、座位数;定义对新增的属性进行显示的方法。
(5) 在测试类的main()方法中分别创建Vehicle和Airplane的对象,调用显示属性的方法。
-Based on object-oriented programming to write a parent class of transport (Transport): (1) property, including speed, load capacity: (2) method and display properties include the constructor method. (3) defines a subclass of Transport Vehicle, Vehicle has its own new properties: the number of wheels, license plate number defined attributes of the new display method. (4) defines a subclass of Transport Airplane, Airplane has its own new properties: the engine type, number of seats defined attributes of the new display method. (5) in the test class main () method to create Vehicle and Airplane were the object, call the display properties.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
src\Transport\Airplane.java
...\.........\Test.java
...\.........\Transport.java
...\.........\Vehicle.java
...\Transport
src
...\.........\Test.java
...\.........\Transport.java
...\.........\Vehicle.java
...\Transport
src