static void Main(string[] args) { SampleClass sampleObject = new SampleClass(); sampleObject[0] = "Sample"; sampleObject[1] = "Iterator"; sampleObject[2] = "Class"; Iterator classIterator = sampleObject.GetIterator(); while (classIterator.HasNext()) { Console.WriteLine(classIterator.Next()); } }
public SampleClassIterator(SampleClass classObject) { this.classObject = classObject; objectSize = this.classObject.Size(); }