文件名称:Management-System-of-car
- 所属分类:
- JSP源码/Java
- 资源属性:
- [Java] [源码]
- 上传时间:
- 2012-12-07
- 文件大小:
- 3kb
- 下载次数:
- 0次
- 提 供 者:
- l**
- 相关连接:
- 无
- 下载说明:
- 别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容均来自于网络,请自行研究使用
某运输公司老板Zhansan开发一车辆管理系统,设有一车辆抽象父类vehicle,子类车种设计成具体类,共有十几种。起初车辆共100辆,后增加卡车truck、轿车car、推土机bulldozer、赛场车venue、公交车bus各一辆。每类车都需要有相同的计算车的数量的方法count()和屏幕输出方法print(),以及不同的启动方法start()。每个启动方法中输出“某某车启动”,如“公交车启动”。如果不想每个子类都重写count()方法和print(),并且每个子类也不想用各自的对象去调用这三个方法,以适应将来增加、变更子类的需要,如何办?系统运行两年后,公交车和赛场车改成电动车,相应的类中需要增加充电方法。每个充电方法中输出“某某车充电”。由于系统维护需要,不允许变动原父类中的代码,并且如果在父类中添加这一充电抽象方法,其它不用充电的车辆类就必须实现这一方法,这是不合理的。同时为了节省代码和适应扩展或变更子类的需要,公交车类和赛场车类如何不用各自的对象而可以调用充电方法。如果父类vehicle中的字符串成员变量holder_name=”zhangsan” 为私有变量,后来该运输公司转让给Lisi,要求在另一个类中可以更改这一变量-The owner of a transport company to develop a vehicle management system Zhansan abstract parent class vehicle has a vehicle subclass of vehicles designed to a specific class, a total of a dozen. At first the vehicle a total of 100, after the increase in truck truck and a sedan car, bulldozer bulldozer, venue of the stadium car, bus bus each. The number of each class cars need to have the same calculation car count () method and screen output method of print (), and the different start methods start (). Output in each boot method "a certain car start", such as "bus start. If you do not want each subclass overrides the count () method and print (), and each sub-class of each object to call the three methods to adapt to future increases do not want to, change the subclass need, how to do? The system is running two years later, the bus changed to electric cars and track cars, the need to increase the charging method in the corresponding class. Each charging method "a certain vehicle chargi
(系统自动生成,下载前可以参看下载内容)
下载文件列表
车辆管理系统
............\Bus.java
............\Car.java
............\ChangeName.java
............\Charging.java
............\Count.java
............\F1.java
............\Print.java
............\Test.java
............\Truck.java
............\Vehicle.java