The JLS gives a hint:
Either way, the receiver parameter exists solely to allow the type of the represented object to be denoted in source code, so that the type may be annotated.
These two methods are equivalent:
class Test {
void m1() { }
void m2(Test this) { }
}
However the latter allows you to add annotations:
void m2(@MyAnnotation Test this) { }
//where MyAnnotation can be defined like this for example:
@Target(ElementType.TYPE_USE) @interface MyAnnotation {}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…