From: Russell Wallace Date: 2007-09-18T14:50:03+09:00 Subject: Re: The meaning of a = b in object oriented languages Summercool wrote: > so most or all object oriented language do assignment by reference? > is there any object oriented language actually do assignment by > value? I kind of remember in C++, if you do > > Animal a, b; > > a = b will actually be assignment by value. > while in Java, Python, and Ruby, there are all assignment by > reference. ("set by reference") > > Is that the case: if a is an object, then b = a is only copying the > reference? Yes, your understanding is exactly correct; C++ will assign by value unless you explicitly use pointers, but the other languages will assign by reference (except for primitive types). -- "Always look on the bright side of life." To reply by email, replace no.spam with my last name.