⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 car.java

📁 1 继承了Vehicle类 bike信息的输入以及重写了toString方法 2 继承了Motorvehicle类 motorcyle信息的输入以及重写了toString方法 3 继承了
💻 JAVA
字号:
package types;

import java.io.*;
/**
 * 继承了Motorvehicle类
 * car信息的输入以及重写了toString方法
 * @author chenlp
 *
 */
public class Car extends Motorvehicle implements Serializable{

	private static final long serialVersionUID = 1L;

	private String seats;

	private String airbags;

	public String type;

	public String leasePlan;

	public Leaser leaser = new Leaser();

	public Car() {
		this.type = "car";
	}

	public String getAirbags() {
		return airbags;
	}

	public String getType(){
		return type;
	}
	
	public void setAirbags(String airbags) {
		this.airbags = airbags;
	}

	public String getSeats() {
		return seats;
	}

	public void setSeats(String seats) {
		this.seats = seats;
	}

	public String toString(){
		return ("姓名: " + leaser.getLeaserName()
				+ "  性别: " + leaser.getSex() + "  证件: "
				+ leaser.getLeaserID() + "  租借日期: "
				+ leaser.getLeaseDate() + "  归还日期: "
				+ leaser.getReturnDate() + "\n" +
		"  编号:      "+ getID() + "\n" +
		"  类型:      " + type + "\n" +
		"  车名:      " + getName()+ "\n" +
		"  生产日期:  " + getDate()+ "\n" +
		"  座位:      " + getSeats()+ "\n" +
		"  安全气囊:  " + getAirbags()+ "\n" +
		"  马力:      " + hp+ "\n" +
		"  引擎:      " + cc+ "\n" +
		"  租借计划:  " +leasePlan+ "\n" +
		"  价值:      " + getEstimatedValue()+ "\n" +
		"  负责人:    " + getAdmin()+ "\n"+"\n");		
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -