日期:2014-05-17 浏览次数:20810 次
public interface ICollection
{
object this[int i] { get; set; }
int Count { get; }
/// /// 获取迭代器 ///
/// /// 迭代器
Iterator GetIterator();
}
/// /// 迭代器接口 ///
public interface Iterator
{
bool MoveNext();
object Current { get; }
}
public class List : ICollection
{
private const int MAX = 10;
private object[] items;
public List()
{
items = new object[MAX];
}
public object this[int i]
{
get
{
return items[i];