public class UseAuto {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
Auto ford = new Ford();
ford.setCar_make("Ford ");
ford.setPrice(20000.0);
ford.disPlay();
Auto chevy = new Chevy();
chevy.setCar_make("Chevy ");
chevy.setPrice(22000.0);
chevy.disPlay();
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
Create an abstract Auto class with fields for the car make and price. Include get and set methods for these fields; the setPrice() method is abstract. Create two suclasses for individual automobile makers (for example, Ford and Chevy) and include appropriate setPrice() methods in each subclass. Finally, write a program that uses the Auto class and subclasses to display information about different cars. The java programs should be named like: Auto.java Ford.java Chevy.java UseAuto.java Sample Output: A new Ford costs $20000.0 A new Chevy costs $22000.0
资源详情
资源推荐
资源评论
收起资源包目录
















共 11 条
- 1
- 2
- 3














资源评论

- shiyusy112013-12-19写得很详细,让我学到了许多java知识。
- hblfgxdf2011-10-31呵呵,写的很仔细,为我省了很多时间,也帮助我系统的复习了java的很多知识!谢谢,望多传啊.....
Xu.y
- 粉丝: 2210
- 资源: 26

上传资源 快速赚钱
我的内容管理 收起
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助

会员权益专享
安全验证
文档复制为VIP权益,开通VIP直接复制
