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

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

靜態(tài)內(nèi)部類通過new外部類().成員的方式訪問外部類的非靜態(tài)成員是怎么訪問的,

請給個(gè)代碼解釋一下謝謝



正在回答

2 回答

new外部類().成員

其實(shí)對應(yīng)代碼中?

Inner inner=new Inner();

inner.ln();是嗎?


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

public class Outer(){

? ? ? ? int score=83;

? ? ? ?public static int Inner(){

? ? ? ? ? ? ? ?public static int In(){

? ? ? ? ? ? ? ? ? ? ? ?int score=93;

? ? ? ? ? ? ? ? ? ? ? ?System.out.println("外部類的score為:"+new Outer().score)

? ? ? ? ? ? ? }

? ? ? ? ? ? ?

? ? ? ?}

}

public static int main(String[]args){

? ? ? ?Inner inner=new Inner();

? ? ? inner.In();

? ? ??

}

這樣運(yùn)行代碼就能輸出該外部類的非靜態(tài)成員了

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

淮陰工學(xué)院計(jì)算機(jī)1161劉濤

內(nèi)部類不要class的嗎?
2018-07-18 回復(fù) 有任何疑惑可以回復(fù)我~

舉報(bào)

0/150
提交
取消

靜態(tài)內(nèi)部類通過new外部類().成員的方式訪問外部類的非靜態(tài)成員是怎么訪問的,

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

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

幫助反饋 APP下載

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

公眾號

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