The syntax for the "class name. This" is called "qualified this" in the Java language. The relevant provisions are here: Chapter 15. Expressions-qualified this
The main purpose of this syntax is to use the outer class name. This syntax when you want to specify the "this" reference for a perimeter class of a nested hierarchy in the method of the inner class. For example, say:
class Foo { class Bar { Foo getFoo() { return Foo.this; } }}
In the Getfoo () method of the Foo.bar class, if you write "This" directly, it refers to an instance of the Foo.bar class, and if you want to specify the this instance of the Outer Foo class, it is written in Foo.this.
In particular, if you write Bar.this in the Getfoo () method of the previous example, the function is the same as writing this directly, specifying the current instance of the Foo.bar class.
Rednaxelafx
Links: https://www.zhihu.com/question/55565290/answer/145355951
Source: Know
Copyright belongs to the author. Commercial reprint please contact the author for authorization, non-commercial reprint please specify the source.
What is the difference between the Java class name and the class name.