Where is my way?

 

随笔分类 -  C#学习

C#集合与接口(二)IEnumerable<T>接口
摘要://字符中迭代 public class ListBoxTest: IEnumerable<String> { private string[] strings; private int ctr = 0; //可枚举的类可以返回枚举 public IEnumerator<string> GetEnumerator() { foreach (string s in strings) { yield return s;//返回可枚举对象 ... 阅读全文

posted @ 2011-10-09 20:45 ManLoveGirls 阅读(338) 评论(0) 推荐(0)

C#集合与接口(一)
摘要:1.集合接口C#提供以下接口ICollection<T> 泛型集合的基接口IEnumerable<T>IEnumerator<T> 实现foreach语句枚举集合ICollection<T> 所有集合都要实现,以提供CopyTo()方法,以及Count、IsSynchronized(线程安全) SyncRoot属性IComparer<T> 比较集合中的两个对象以对集合的排序IComparable<T> IList<T> 肜于数组可索引的集合IDictionary<K,V> 用于基于<键,值&g 阅读全文

posted @ 2011-10-09 20:27 ManLoveGirls 阅读(418) 评论(0) 推荐(0)

c#学习(一)队列
摘要:using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace QueueEx{ class Program { static void Main(string[] args) { Queue<int> iQueue = new Queue<int>();//构造一个整型集合队列 for (int i = 0; i < 10; i++) iQueue.Enqueu... 阅读全文

posted @ 2011-10-06 21:11 ManLoveGirls 阅读(325) 评论(0) 推荐(0)

导航