educative.io

Using "this" keyword to refer to headNode while implementing Linked List in Java

Hello, while implementing LinkedList in java, some of the methods used “this” keyword when referring to headNode. Is there any benefit in doing so?

The main purpose of using this keyword in Java is to remove the confusion between class attributes and parameters that have same names. No other benefit.