Generic Classes
I've been stuck on this problem for a while and I can't seem to figure it out!!! using System; using System.Collections.Generic; namespace SoloLearn { class Program { static void Main(string[] args) { Elems<string> elems1 = new Elems<string>(); elems1.Add("John", "Tamara", "David"); elems1.Show(); Console.WriteLine(); Elems<int> elems2 = new Elems<int>(); elems2.Add(5, 14, 13); elems2.Show(); } } //make this class generic class Elems { public int[] elements = new int[3]; public void Add(int elem1, int elem2, int elem3) { elements[0] = elem1; elements[1] = elem2; elements[2] = elem3; } public void Show() { foreach (int item in elements) { Console.Write(item + " "); } } } }