文件名称: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
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.