第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定

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

幫忙看一下,為啥輸出沒有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 回復 有任何疑惑可以回復我~

我找到原因了。

0 回復 有任何疑惑可以回復我~

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

1 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消

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

我要回答 關注問題
微信客服

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

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網(wǎng)微信公眾號