国产精品天干天干,亚洲毛片在线,日韩gay小鲜肉啪啪18禁,女同Gay自慰喷水

歡迎光臨散文網(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的評論 (共 條)

分享到微博請遵守國家法律
玉门市| 威海市| 盐亭县| 泽州县| 沈丘县| 漯河市| 邹城市| 麻栗坡县| 稻城县| 高邮市| 尖扎县| 潢川县| 广昌县| 武冈市| 福安市| 临清市| 翁牛特旗| 双流县| 诸暨市| 萍乡市| 洛隆县| 新乡市| 恭城| 台东县| 河东区| 沧州市| 额济纳旗| 乌兰浩特市| 古田县| 柳州市| 哈密市| 巧家县| 抚顺市| 平顺县| 宁强县| 铜陵市| 香河县| 尼玛县| 鸡泽县| 奉贤区| 西盟|