根据以下类的关系编码实现该图中出现各个类,汽车(#自重:int)(#载量:double)(#颜色:string)+启动方式+驱动方式→小汽车(#载客数:int)→客车(#载客数:int)(#卫生间:string)→货车(#自卸否:bool)
2 回答

九州编程
TA贡献1785条经验 获得超4个赞
class 汽车{
int 自重;
double 载量;
string 颜色;
string 启动方式;
string 驱动方式;
}
class 小汽车 extends 汽车{
super();
int 载客数;
}
class 客车 extends 汽车{
super();
int 载客数;
}
class 货车 extends 汽车{
super();
boolean 自卸否;
}
添加回答
举报
0/150
提交
取消