最近中文字幕高清中文字幕无,亚洲欧美高清一区二区三区,一本色道无码道dvd在线观看 ,一个人看的www免费高清中文字幕

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定

我用IntelliJ IDEA賦值,執(zhí)行時(shí)沒有輸出?

幫忙看一下,為啥輸出沒有age那些賦值的參數(shù)。

public?class?IniTest1?{
????public?static?void?main(String[]?args)?{
????????Test1?test1=new?Test1();
????????test1.age=120;
????????test1.height=199f;
????????test1.name?="Allen";
????????test1.eat();
????????test1.talk();
????}
}
public?class?Test1?{
????String?name;
????int?age;
????float?height;
????void?talk(){
????????System.out.println("You?can?talk?to?others");
????}
????void?eat(){
????????System.out.println("You?can?eat?what?you?want?to?");
????}
}

只輸出了以下內(nèi)容

You can eat what you want to?

You can talk to others


Process finished with exit code 0


正在回答

3 回答

sdfasd

0 回復(fù) 有任何疑惑可以回復(fù)我~

我找到原因了。

0 回復(fù) 有任何疑惑可以回復(fù)我~

你的值確實(shí)賦給各個(gè)參數(shù)了,參數(shù)值已經(jīng)是你賦給他的值,但是你并沒有print出這些屬性值,想要輸出的話,可以將這些參數(shù)寫入printf語(yǔ)句中

1 回復(fù) 有任何疑惑可以回復(fù)我~

舉報(bào)

0/150
提交
取消

我用IntelliJ IDEA賦值,執(zhí)行時(shí)沒有輸出?

我要回答 關(guān)注問題
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)