While you are correct that string is a reference type, you cannot change which string the local variable str in Main is referencing from the StringConvert function since you pass it by value. All you can do is make the parameter to StringConvert refer to another string, which will have no effect outside the function. In the case where you passed a Class1, you are modifying the reference contained in the object referred to by the parameter, which is the same object referred to in Main. If you had put the line c = new Class1(); as the first line in StringConvert, it would no longer change the value in Main because the parameter in StringConvert would now be referring to a different object.