Assignments to a memory variable from another memory variable do not create a copy for reference types; however, they do create a new copy for value types. The code listing shown in the following screenshot illustrates that value type variables in memory are copied by value. The value of localVar1 is not affected by change in value of the localVar2 variable:
The code listing shown in the following screenshot illustrates that reference type variables in memory are copied by reference. The value of otherVar is affected by change in the someVar variable: