代码改变世界

随笔档案-2010年11月

值类型与引用类型初窥

2010-11-26 13:32 by Shawn.Cheng, 155 阅读, 收藏,
摘要: 没有时间写废话,直接上测试代码。 class TestAddressRef { public int num; }class Program { static void Main(string[] args) { TestAddressRef tar1=new TestAddressRef(); tar1.num = 1; TestAddressRef tar2 = tar1; TestAddressRef tar3=new TestAddressRef(); TestAddressRef tar4 = tar3; tar3.num ... 阅读全文