10 2015 档案

摘要:一、接口的作用:我们定义一个接口:public interface IBark{ void Bark();}1、 再定义一个类,继承于IBark,并且必需实现其中的Bark()方法public class Dog:IBark{ public Dog() {} public v... 阅读全文
posted @ 2015-10-26 16:44 Bobwei 阅读(848) 评论(0) 推荐(2)
摘要:一、ArrayList 与 string、string[]数组的转换 1.ArrayList 转换为 string[] : ArrayList list = new ArrayList(); list.Add("aaa"); list.Add("bbb"); //转换成数组 str... 阅读全文
posted @ 2015-10-19 19:03 Bobwei 阅读(841) 评论(0) 推荐(0)
摘要:在C#中,ArrayList,List都能够存储一组对象,那么这三者到底有什么样的区别呢。数组 数组在C#中是最早出现的。它在内存中是连续的存储的,所以索引速度很快,而且赋值与修改元素也很简单。可以利用偏移地址访问元素,时间复杂度为O(1);可以用折半查找法查找元素,效率高。 string[] s... 阅读全文
posted @ 2015-10-11 13:24 Bobwei 阅读(41219) 评论(1) 推荐(10)