'this' always refers to whichever object it's used within.
Say for example you have an object which stores apples, call it a basket, and an apple object which wants to get into the basket.
There's two ways of doing it, one is that some all encompassing class which has a basket and apple object adds the apple to the basket, it can use the proper names of the objects to do this.
The other way however is that the apple knows about the basket, and puts itself in the basket. Now the apple doesn't know its own name, but it can call itself "this" and things will work out.
or in code:
Code://myBasket has an add(Apple a) method.
//in the global method:
Apple myApple=new Apple();
Basket myBasket=new Basket();
myBasket.add(myApple);
//in the non-global method
//in the Apple class:
void addToBasket(Basket b)
{
b.add(this); // "this" refers to this sepcific Apple
}
//and then at the global level
Apple myApple=new Apple();
Basket myBasket=new Basket();
myApple.addToBasket(myBasket); //so myApple adds itself to the basket
This example is a bit contrived since we know this Apple is called myApple but you'll have to imagine more complex cases where things aren't so straightforward and no one "global" function knows about all the constituent parts.
This is also used for example if the "addToBasket" method does some work within the Apple.. setting various internal state for example.