摘要: .net中,其字符串特有的驻留机制,保证了在同一进程中,相同字符序列的字符串,只有一个实例,这样能避免相同内容的字符串重复实例化,以减少性能开销。先来回顾一下c#中的代码:View Code 1 public static void testString() 2 { 3 String s = "Abc"; 4 String s1 = "abc"; 5 String s2 = "abc"; 6 7 8 Console.WriteLine("s1==s2 ? " +... 阅读全文
posted @ 2012-12-10 22:06 菩提树下的杨过 阅读(1842) 评论(1) 推荐(1) 编辑