using System; using System.Collections; using System.Collections.Generic; public class DaysOfTheWeek { public string[] days = { "Sun", "Mon", "Tue", "Wed", "Thr", "Fri", "Sat" }; /* public System.Collections.IEnumerator GetEnumerator() { for (int i = 0; i < days.Length; i++) { yield return days[i]; } } */ } class c2602 { static void Main() { // Create an instance of the collection class DaysOfTheWeek week = new DaysOfTheWeek(); // Iterate with foreach /* foreach (var day in week) { System.Console.Write(day + " "); } */ foreach (var day in week.days) { System.Console.Write(day + " "); } Console.WriteLine(); } }//