更新時(shí)間:2020-08-14 16:26:20 來源:動(dòng)力節(jié)點(diǎn) 瀏覽2152次
public?class?DotThis?{
????public?class?Inner{
????????public??DotThis?outer(){
????????????return??DotThis.this;
????????};
????}
????/*
1.第一種 必須創(chuàng)建獲取內(nèi)部類的方法
public??Inner?inner(){
????????return?new?Inner();
????}*/
????public?static?void?main(String[]?args)?{
????????//DotThis?dt?=?new?DotThis();
????????//DotThis.Inner?dti=dt.inner();
2.第二種直接就能獲取到
??????DotThis?dotThis?=?new?DotThis();
????????Inner?inner?=?dotThis.new?Inner();
????}
}
以上就是動(dòng)力節(jié)點(diǎn)java培訓(xùn)機(jī)構(gòu)的小編針對(duì)“Java內(nèi)部類調(diào)用的方式”的內(nèi)容進(jìn)行的回答,希望對(duì)大家有所幫助,如有疑問,請(qǐng)?jiān)诰€咨詢,有專業(yè)老師隨時(shí)為你服務(wù)。
相關(guān)閱讀
0基礎(chǔ) 0學(xué)費(fèi) 15天面授
有基礎(chǔ) 直達(dá)就業(yè)
業(yè)余時(shí)間 高薪轉(zhuǎn)行
工作1~3年,加薪神器
工作3~5年,晉升架構(gòu)
提交申請(qǐng)后,顧問老師會(huì)電話與您溝通安排學(xué)習(xí)
初級(jí) 202925
初級(jí) 203221
初級(jí) 202629
初級(jí) 203743