Java: Class.this

前端 未结 5 1172
野趣味
野趣味 2020-11-27 11:41

I have a Java program that looks like this.

public class LocalScreen {

   public void onMake() {
       aFuncCall(LocalScreen.this, oneString, twoString);
          


        
5条回答
  •  -上瘾入骨i
    2020-11-27 12:05

    It means the this instance of the outer LocalScreen class.

    Writing this without a qualifier will return the instance of the inner class that the call is inside of.

提交回复
热议问题