实习接收函及申请书样版_第1页
实习接收函及申请书样版_第2页
实习接收函及申请书样版_第3页
实习接收函及申请书样版_第4页
实习接收函及申请书样版_第5页
已阅读5页,还剩3页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、2、根据实验三中定义的矩形类,定义子类RoundRectangle定义属性radius表示圆角半径,定义带三个参数的构造方法,参数分别是height,width和radius,调用父类Rectangle中带参数的构造方法实现。1. 父类:package ct4;public class Mobile private String name;public Mobile(String name super(; = name;public Mobile( super(;/ TODO Auto-generated constructor stubpublic void run(Sys

2、tem.out.println("行驶"public void stop(System.out.println("刹车"子类:package ct4;public class Truck extends Mobile public Truck( super(;/ TODO Auto-generated constructor stubpublic Truck(String name super(name;/ TODO Auto-generated constructor stubpublic void run(System.out.println(&qu

3、ot;卡车烧柴油"package ct4;public class Car extends Mobile public Car( super(;/ TODO Auto-generated constructor stubpublic Car(String name super(name;/ TODO Auto-generated constructor stubpublic void run(System.out.println("轿车烧汽油"测试类:package ct4;public class MobileTest public static void ma

4、in(String args / TODO Auto-generated method stubTruck t = new Truck(;t.run(;t.stop(;System.out.println("n"Car c = new Car(;c.run(;c.stop(;2. package ct66;public class Rectangle double height;double width;public double getHeight( return height;public void setHeight(double height this.height

5、 = height;public double getWidth( return width;public void setWidth(double width this.width = width;public Rectangle(double height, double width super(;this.height = height;this.width = width;public Rectangle( super(;/ TODO Auto-generated constructor stubpublic double getArea(return height*width;pub

6、lic void show(System.out.println("矩形的长为:"+height;System.out.println("矩形的宽为:"+width;System.out.println("矩形的面积为:"+getArea(;package ct66;public class RoundRectangle extends Rectangleprivate double radius;public RoundRectangle(double height,double width,double radiussuper(h

7、eight,width;this.radius=radius;第五题:1、交通工具(Transportation)分为:汽车(Mobile)、飞机(Plain),各种交通工具的运输(transport)方法各不相同,编写一个测试类TransportationTest,要求如下。编写方法testTransport,对各种交通工具进行运输测试。要依据交通工具的不同,进行相应的运输。2、利用接口实现(1)的功能。1. package ct5;public class Transportation private String transportationName;public String getT

8、ransportationName( return transportationName;public void setTransportationName(String transportationName this.transportationName = transportationName;接 收 函广西农业职业技术学院商贸管理系:我单位同意接收你院商贸管理系专业班年 月 日super(;this.transportationName = transportationName;并督促其认真完成实习任务单位名称(盖章):(transportationName"联系package ct5;public classsuper(MobileName尊敬的我是商贸管理 Transport(System.out.println(super.getTransportationName(+",本学期系部安排package ct5;public class Plain extends Transportationpublic Plain (String PlainNamesuper(PlainName;并特此申请,恳请public voi

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

最新文档

评论

0/150

提交评论