2 using System
.Collections
;
3 using System
.Collections
.Generic
;
5 public class BaseCollection
<T
> : IEnumerable
<T
>
7 protected List
<T
> items
= new List
<T
> ();
9 IEnumerator
<T
> IEnumerable
<T
>.GetEnumerator ()
11 return items
.GetEnumerator ();
14 IEnumerator IEnumerable
.GetEnumerator ()
16 return items
.GetEnumerator ();
20 public class BaseIntList
<T
> : BaseCollection
<T
>
24 public class IntList
: BaseIntList
<int>
30 public static void Main ()
32 IntList list
= new IntList ();
33 foreach (int i
in list
) {
34 Console
.WriteLine (i
);