課程
/后端開發(fā)
/Java
/Java入門第二季 升級(jí)版
???//
2019-12-08
源自:Java入門第二季 升級(jí)版 10-1
正在回答
package com.imooc.two;
public class Vehicle {
? ? ?int Num;
? ? ?String Way;
? ? ?public void showWay(String Way){
? ? ?}
? ? ?public void shoeNum(int Num){
}
public class Plane extends Vehicle {
@Override
public void showWay(String Way) {
// TODO Auto-generated method stub
super.showWay(Way);
System.out.println("載客方式:"+Way);
public void shoeNum(int Num) {
super.shoeNum(Num);
System.out.println("運(yùn)輸人數(shù)為:"+Num);
}? ? ??
public class VehicleInitail {
public static void main(String[] args) {
Vehicle plane=new Plane();
Vehicle boat=new Plane();
Vehicle bus=new Plane();
plane.showWay("飛機(jī)");
plane.shoeNum(50);
plane.showWay("輪船");
plane.shoeNum(200);
plane.showWay("公交車");
plane.shoeNum(80);
這是別人寫的,我拿來借鑒,剛好你需要
沒有哦
舉報(bào)
課程升級(jí)!以終為始告別枯燥,在開發(fā)和重構(gòu)中體會(huì)Java面向?qū)ο缶幊痰膴W妙
2 回答我的代碼作業(yè)
1 回答作業(yè)代碼,傻瓜版
2 回答作業(yè)代碼區(qū)別問題
3 回答附帶輸入?yún)?shù)的作業(yè)代碼
2 回答我的作業(yè)還行嗎
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號(hào)-11 京公網(wǎng)安備11010802030151號(hào)
購(gòu)課補(bǔ)貼聯(lián)系客服咨詢優(yōu)惠詳情
慕課網(wǎng)APP您的移動(dòng)學(xué)習(xí)伙伴
掃描二維碼關(guān)注慕課網(wǎng)微信公眾號(hào)
2020-05-06
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("運(yùn)輸人數(shù)為:"+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("飛機(jī)");
plane.shoeNum(50);
plane.showWay("輪船");
plane.shoeNum(200);
plane.showWay("公交車");
plane.shoeNum(80);
}
}
這是別人寫的,我拿來借鑒,剛好你需要
2019-12-12
沒有哦