@Conor
Only the new keyword creates a new instance. The rest of the time you are just dealing with the instance that you created earlier. In the case of mainGUI m = new mainGUI(); a new instance of mainGUI is created and the *reference* to this instance is saved to m. So, the instance is created somewhere in the memory. You then get the address of the place where it is located. And this address(reference) is saved to m. Untill you assign something else to m it will keep pointing to the same place in the memory.