关注联楷|返回首页 | 网站案例 | 帮助中心

合作共赢、快速高效、优质的网站建设提供商

上海网站建设 

服务热线:021-61394118

上海联楷科技

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

上海联楷网络新闻