2013年8月23日
摘要: 知道“StringBuilder比string性能强”好多年了,近日无聊病发作,就把这两个家伙给动了手术:using System;using System.Text;namespace ConsoleApplication1{ classProgram { staticvoid Main(string[] args) { int start = Environment.TickCount; //计时打点 fun1(); int middle = Environment.TickCount; //计时打点 fun2(); int end = Environment.TickCount; //计 阅读全文
posted @ 2013-08-23 01:10 布史 阅读(859) 评论(1) 推荐(1) 编辑
摘要: 1. 值类型与引用类型比较classProgram{ staticvoid Main() { int a = 9; //给变量a赋值为9 int b = a; //将a的副本给变量b b = 10; Console.WriteLine(string.Format("a={0},b={1}", a, b)); Person ZS = newPerson(); //张三 ZS.Age = 99; //张三的年龄是99 Person SM = ZS; //三毛等于张三,即张三和三毛就是同一个人 SM.Age = 100; //三毛年龄变成100,张三也就变成了100 Consol 阅读全文
posted @ 2013-08-23 00:15 布史 阅读(632) 评论(2) 推荐(1) 编辑