View Single Post
Old May 23rd, 2006, 10:44 AM   #13
NSchnarr
Newbie
 
Join Date: May 2006
Posts: 28
Rep Power: 0 NSchnarr is on a distinguished road
About your x y question on int variables.
If you have x = 5, y = 10
then do x = y;
x = 10, y = 10,
now if you do y = 15;
x = 10, y = 15
Basicly these types of variables (primitives) store there value with the variable name in memory.
Objects on the other hand point to there values(referenced),
so if you have
obj x = 'ex1', obj y='ex2'
x = y (this makes them point to the same place in memory)
x = 'ex2', y = 'ex2'
Any change made to one, changes the other.
x = 'ex1'
x = 'ex1' y = 'ex1'
NSchnarr is offline   Reply With Quote