using System.Collections.Generic;
public static void Main()
var objCollection = (ICollection<object>) new List<object>
Console.WriteLine(objCollection.First() as string);
Console.WriteLine(objCollection.Last() as string);
Console.WriteLine(objCollection.ElementAt(1) as string);
Console.WriteLine((objCollection.ElementAtOrDefault(99) as string) ?? "Index was out of range");