AndroidMan wrote:
wouldn't that just swap the class instances of AndroidMan themselves and all of its memeber values? If we just wanted to swap an instance variables from 2 separate androidMan instances my code is applied for that, as I assumed we were speaking of specific instance variables inside of a class to swap.
FIrst there are a bunch of compilation problems - I'll overlook those as typing into a text box.
Second, the test was to swap the value of two instance variables. Objects can be instance variables, just like a primitive. So I don't know why you are trying to show two objects swapping values of a specific attribute? Really the answer I was looking for (if you were going to use Java) was something like this:
void swap(Object a, Object b) {
Object x = a;
Object b = a;
Object a = b;
}
Then you could use the same method to swap values of different types (provided it's not a primitive)...
GTG - can't believe how much time I spent in here today.
Play time is over.