There are two objects:
Object1, Object2
You can easily swap them by:
Object3 = Object1
Object1 = Object2
Object2 = Object3
However, you must solve this problem by using no temporary object and Object1 should be changed to Object 2. (and vice versa)