Vehicle类 package d A public class Vehicle private int wheels private double weight Vehicle weight wheels Vehicle int lun, double zizhong wheels lun weight zizhong public int getWheels return wheels p ...
2016-09-22 17:37 0 6312 推荐指数:
#29.编写一个Java应用程序,设计一个汽车类Vehicle,包含的属性有车轮个数 wheels和车重weight。小车类Car是Vehicle的子类,其中包含的属性有载人数 loader。卡车类Truck是Car类的子类,其中包含的属性有载重量payload。每个 类都有构造方法和输出 ...
package com.hanqi.test; public class jidongche { private String chepaihao;//车牌号 private int speed;//速度 private double weight;//载重量 //无参构造方法 ...
package com.hanqi.test; public class Car { private String carNo; private int speed; private double support; public Car() { carNo="XX1234"; speed=100 ...
//矩形父类 package d922A; public class Rect { private double l,w; Rect(double c,double k) { l=c; w=k; } public double s() { return w*l; } } ///立方体类 ...