1 Star 0 Fork 0

Java45_张奭/javaoop多态

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
C05TestRent.java 957 Bytes
一键复制 编辑 原始数据 按行查看 历史
package cn.hfkh.oop;
public class Code005TestRent {
public static void main(String[] args) {
int days;
int totalMoney;
// 1、客户租赁的多辆汽车信息及租赁天数
Code005MotoVehicle motos[] = new Code005MotoVehicle[4];
motos[0] = new Code005Car("京NY28588", "宝马", "550i");
motos[1] = new Code005Car("京NNN3284", "宝马", "550i");
motos[2] = new Code005Car("京NT43765", "别克", "林荫大道");
motos[3] = new Code005Bus("京5643765", "金龙", 34);
days = 5;
// 2、计算总租赁费用
Code005Customer customer = new Code005Customer("s070537", "沈伟");
totalMoney = customer.calcTotalRent(motos, days);
// 输出客户姓名和总租赁费用
System.out.println("汽车牌号\t\t汽车品牌");
for (int i = 0; i < motos.length; i++) {
System.out.println(motos[i].getNo() + "\t" + motos[i].getBrand());
}
System.out.println("\n客户名:" + customer.getName() + ",租赁天数:" + days
+ ",租赁总费用:" + totalMoney + "。");
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/zhangshi66/javaoopDuoTai.git
[email protected]:zhangshi66/javaoopDuoTai.git
zhangshi66
javaoopDuoTai
javaoop多态
master

搜索帮助