Java內(nèi)部類調(diào)用的方式

Java內(nèi)部類調(diào)用的方式

深圳達內(nèi)教育      2022-03-28 23:20:01     15

Java內(nèi)部類調(diào)用的方式,public?class?DotThis?{????public?class?Inner{????????public??DotThis?outer(){???????????

課程價格 請咨詢

上課時段: 授課校區(qū):

詳細介紹

public?class?DotThis?{????public?class?Inner{????????public??DotThis?outer(){????????????return??DotThis.this;????????};????}????????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();????}}

以上就是深圳達內(nèi)教育java培訓機構(gòu)的小編針對“Java內(nèi)部類調(diào)用的方式”的內(nèi)容進行的回答,希望對大家有所幫助,如有疑問,請在線咨詢,有專業(yè)老師隨時為你服務。

培訓啦提醒您:交易時請核實對方資質(zhì),對于過大宣傳或承諾需謹慎!任何要求預付定金、匯款等方式均存在風險,謹防上當。