文件名称:JAVA面向对象编程-试卷B
介绍说明--下载内容均来自于网络,请自行研究使用
定义一个交通工具类Traffic,该类包含属性:车轮的数量、行驶速度;同时还包含行驶的方法,并包含有参和无参的构造方法。请分别定义汽车类Car(包含油耗的属性,有参的构造方法)、火车类Train(无参的构造方法)、飞机类Plane(包含最大航程的属性,包含无参和有参的构造方法),让他们继承Traffic,并重写行驶的方法。在测试类中分别创建三个子类的对象,并调用行驶的方法。((A vehicle class Traffic is defined, which contains attributes: the number of wheels, the speed of travel, and the method of driving, including the parametric and parametric construction methods. Please define auto Car (with the construction method of ginseng contains fuel properties), Train (train class construction method of no arguments), class Plane (including aircraft attributes, the maximum range contains no parameters and construction method of ginseng), let them inherit the Traffic method, and override driving. In the test class, three objects of the subclass are created, and the driving method is called. ()
相关搜索: java考试题
(系统自动生成,下载前可以参看下载内容)
下载文件列表
JAVA面向对象编程-试卷B.doc