// swap references a and b Thing a = new Thing( 1 ); Thing b = new Thing( 2 ); // save a copy of "a" you are about to clobber Thing swap = a; a = b; b = swap; // avoid packratting Thing( 1 ) swap = null;