📄 vehicle.java
字号:
//vehicle.java
//定义父类Vehicle
class Vehicle
{
//父类的公共数据成员
public int speed;
public String maintanceRecord;
public Vehicle()
{
//类成员初始化
this.speed = 0;
this.maintanceRecord = "";
}
public Vehicle(int speed,String maintanceRecord)
{
//类成员初始化
this.speed = speed;
this.maintanceRecord = maintanceRecord;
}
//父类的公共成员方法
public int getSpeed()
{
return speed;
}
//父类的公共成员方法
public String getMaintanceRecord()
{
return maintanceRecord;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -