Even if you have multiple instances of an object, this will always refer to the current object the method is being called from.
public class Demo
{
String toDisplay;
public Demo(String toDisplay)
{
this.toDisplay = toDisplay;
}
public void display(Demo demo2)
{
System.out.println("I'm displaying this demo's toDisplay: " + this.toDisplay);
System.out.println("Now displaying demo2's toDisplay: " + demo2.toDisplay);
}
public static void main(String[] args)
{
Demo d1 = new Demo("demo1");
Demo d2 = new Demo("demo2");
d1.display();
}
}