SortedSet enrolled; foreach (Student slacker in enrolled) // .... Dictionary slacker; map mapOfStuff; // the mapOfStuff contains pairs that look like the one below Pair pairs; foreach (KeyValuePair i in slacker) { Console.WriteLine(String.Format("This key {0} is paired with this value {1}", i.Key, i.Value)); }