最美情侣中文字幕电影,在线麻豆精品传媒,在线网站高清黄,久久黄色视频

歡迎光臨散文網(wǎng) 會員登陸 & 注冊

請使用繼承關(guān)系實現(xiàn)下列描述:(較難)自行車和豪車屬于車類型車(car):車牌號(ci

2023-02-27 08:33 作者:酸奶公園  | 我要投稿

請使用繼承關(guān)系實現(xiàn)下列描述:

(較難)

自行車和豪車屬于車類型

車(

car

):車牌號(

cid

)、車型(

dtype

)、價值(

cvalue

自行車(

bicycle

):車牌號(

cid

)、車型(

dtype

)、價值(

cvalue

)、鏈條

chain

豪車(

limo

):車牌號(

cid

)、車型(

dtype

)、價值(

cvalue

)、導航

(guide)

class

car{

protected

String

cid

;

protected

String

dtype

;

protected

int

cvalue

;

public

car(String

id

,String

type

,

int

value

){

cid

=

id

;

dtype

=

type

;

cvalue

=

value

;

}

}

class

bicycle

extends

car{

String

chain

;

public

bicycle(String

id

,String

type

,

int

value

,String

chain

){

super

(

id

,

type

,

value

);

this

.

chain

=

chain

;

}

public

void

display(){

System.

out

.println(

"

自行車車牌號:

"

+

cid

+

"

車型:

"

+

dtype

+

"

價值:

"

+

cvalue

+

"

:"

+

chain

);

}

}

class

limo

extends

car{

public

limo(String

id

,String

type

,

int

value

){

super

(

id

,

type

,

value

);

}

public

void

guide(){System.

out

.println(

"

我有導航功能。

"

);}

public

void

display(){

System.

out

.println(

"

豪車車牌號:

"

+

cid

+

"

車型:

"

+

dtype

+

"

價值:

"

+

cvalue

);

guide();

}

}

public

class

testCar {

public

static

void

main(String[]

args

) {

//

TODO

Auto-generated method stub

bicycle

bike

=

new

bicycle(

"28"

,

"

永久

"

,300,

"KMC"

);

bike

.display();

limo

li

=

new

limo(

"A0000"

,

"

幻影

"

,2000000);

li

.display();

}


請使用繼承關(guān)系實現(xiàn)下列描述:(較難)自行車和豪車屬于車類型車(car):車牌號(ci的評論 (共 條)

分享到微博請遵守國家法律
麟游县| 齐齐哈尔市| 咸丰县| 大名县| 盐边县| 关岭| 图木舒克市| 林甸县| 宁武县| 临颍县| 吴忠市| 正安县| 延安市| 桓仁| 新龙县| 屏山县| 景泰县| 法库县| 平潭县| 托克逊县| 清新县| 安乡县| 长沙县| 湘阴县| 垫江县| 仁化县| 綦江县| 增城市| 嘉鱼县| 修水县| 瓮安县| 盐边县| 洪雅县| 贵溪市| 台州市| 柳州市| 仪征市| 恩平市| 霍州市| 德格县| 云和县|