static void Main(string[] args) { //Generic solution DataSample <String> dss = new DataSample <string>("Forty-two"); DataSample <int> dsi = new DataSample <int>(42); String s = dss.GetData(); int i = dsi.GetData(); String[] words = { "C++", "MacOS", "C#", "Android", "Python" }; String middle = DataSample <String> .getMiddleElement(words); Console.WriteLine(String.Format("s={0}, i={1} and middle={2}", s, i, middle)); Console.ReadKey(); }