public class DotThis {
public class Inner{
public DotThis outer(){
return DotThis.this;
};
}
/*
1.第一种 必须创建获取内部类的方法
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();
}
}

相关文章:

  • 2021-08-18
  • 2022-12-23
  • 2021-12-13
  • 2021-08-10
  • 2022-12-23
  • 2021-07-21
  • 2022-02-14
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-09
  • 2021-10-03
相关资源
相似解决方案