c#中预定义的引用类型
作者:佚名 时间:2013-11-07
1.object:所有类型的基类
2.string:string是引用类型,但特殊于其他的引用类型,修改一个string对象的值是重新生成一个新的对象而不是改变原来内存的值,通过以下代码可以很好地了解这一点.
string hello1 = "hello world!";
hello2 = hello1;
hello1 ="hello";
console.writeline(hello1); //hello
console.writeline(hello2); //hello world!
如没特殊注明,文章均为上海联楷网络原创,转载请注明来自:http://www.linksj.com/hynews/20151126/n3136.html