using System.Collections.Generic;
public static void Main()
var wordArray = new string[]{"word", "Array"};
var wordList = new List<string>{"word", "List"};
GenericPrintWords(wordArray);
Console.WriteLine(new string ('*', 30));
GenericPrintWords(wordList);
public static void GenericPrintWords<T>(IEnumerable<T> words)
foreach (var word in words)
public static void ListPrintWords<T>(List<T> words)
words.ForEach(word => Console.WriteLine(word));