Ad
  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Default User Avatar

    It's used to refer to objects that are specific to that method. Since different classes can override methods, the use of "this" basically eleminated confusion between classes that have the same parameter.
    So for example, two methods may both have int x but using "this.x", you can specify that it's this x for this specific method.

    If you have a good understanding of method overriding then this would be more understandable. I hope I cleared up some confusion ;)

  • Custom User Avatar

    Maybe because it's bad in terms of complexity and it mutates the input.