using System.Collections.Generic;
public static void Main()
string[] emptyBasket = {};
string[] fruits = {"apple", "mango", "yakfruit", "canneryfruit", "orange", "passionfruit", "grape", "pear"};
string elementAtFour = fruits.ElementAt(4);
Console.WriteLine("The string at fruits[4] is: {0}", elementAtFour);
string notInTheList = fruits.ElementAtOrDefault(outOfArray);
Console.WriteLine("notInTheList's type is \'{0}\'", notInTheList);
Console.WriteLine("Element [{0}] in fruits is {1}", outOfArray, String.IsNullOrEmpty(notInTheList) ? "Nothing here, you missed the array" : notInTheList);