Java: Why can the 'this' keyword be used in a method parameter?

Viewed 31

The following class compiles in a program on a Java 8 standard compiler:

public class Test {
   public void m1(Test this) {

   }
}

If you don't believe me, try it.

What is the meaning of this syntax? It doesn't seem to affect much about the behavior of the function, or the keyword itself. Does it have a name, and what is different from not including such a parameter? Does it only exist for historical reasons?

0 Answers
Related