<分区>
Possible Duplicate:
C# string reference type?
比如说,我有一个字符串叫做
string sample = "Initial value";
传递给方法test()之后
public static void Test(string testString)
{
testString = "Modified Value";
}
如果我在通过 Test(sample) 后打印“sample”,除了它应该打印“Modified Value”。
但它打印“初始值”。如果字符串是引用类型,为什么会出现这种情况?
但同样(预期的逻辑),为对象工作。有人可以清除我吗?