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

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

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

請給個代碼解釋一下謝謝



正在回答

2 回答

new外部類().成員

其實對應代碼中?

Inner inner=new Inner();

inner.ln();是嗎?


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

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();

? ? ??

}

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

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

淮陰工學院計算機1161劉濤

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

舉報

0/150
提交
取消

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

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

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

幫助反饋 APP下載

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

公眾號

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