If the only reference to the object is a local variable within the method, then the object goes away once code execution returns from the method. If you need to reference the object elsewhere, assign it to a member of the class.