2 // This program excercises invoking foreach on structures
3 // that implement GetEnumerator
7 using System
.Collections
;
11 public IEnumerator
GetEnumerator ()
13 a
= new int [3] { 1, 2, 3}
;
14 return a
.GetEnumerator ();
26 foreach (object a
in x
){
35 foreach (object a
in new X ()){
46 foreach (object a
in x
)