muke的三好学生
2019-12-08 18:30
???//
package com.imooc.two;
public class Vehicle {
int Num;
String Way;
public void showWay(String Way){
}
public void shoeNum(int Num){
}
}
package com.imooc.two;
public class Plane extends Vehicle {
@Override
public void showWay(String Way) {
// TODO Auto-generated method stub
super.showWay(Way);
System.out.println("载客方式:"+Way);
}
@Override
public void shoeNum(int Num) {
// TODO Auto-generated method stub
super.shoeNum(Num);
System.out.println("运输人数为:"+Num);
}
}
package com.imooc.two;
public class VehicleInitail {
public static void main(String[] args) {
// TODO Auto-generated method stub
Vehicle plane=new Plane();
Vehicle boat=new Plane();
Vehicle bus=new Plane();
plane.showWay("飞机");
plane.shoeNum(50);
plane.showWay("轮船");
plane.shoeNum(200);
plane.showWay("公交车");
plane.shoeNum(80);
}
}
这是别人写的,我拿来借鉴,刚好你需要
没有哦
Java入门第二季 升级版
530560 学习 · 6091 问题
相似问题