Generic_Class_Type1
Similar task can be done Using Indexers, Indexer_string_to_int1.htm
Code :

using System;
using System.ComponentModel;
using System.Collections.Generic;
//csc reflection_type1.cs
// compare with //csc Indexer_string_to_int1.cs
using System.Reflection;
// csc Generic_Class_Type1.cs
namespace ConsoleApplication1
{
public class Generic<T>
{
private List<T> list = new List<T>();
public void Add(T item)
{
list.Add(item);
}
// A method to provide an enumerator from the underlying list
public IEnumerator<T> GetEnumerator()
{
return list.GetEnumerator();
}

}

class MainClass
{

public static void Main(string[] args)
{
Console.WriteLine("Using public class Generic<T>");
Console.WriteLine("This Calss wil Enumerate String or Int");
Generic<string> months = new Generic<string>();
Generic<int> index = new Generic<int>();

months.Add("Jan");
months.Add("Feb");
months.Add("Mar");
months.Add("Apr");
months.Add("May");
//
index.Add(1);
index.Add(2);
index.Add(3);
index.Add(4);
index.Add(5);
foreach(Object obj in months )
{
Console.Write("\t" + obj +"");
}
// Generic class can enumerate int and string
Console.WriteLine();
foreach (Object obj in index)
{
Console.Write("\t " + obj+" ");
}
//
Console.ReadLine();
}
//
}
}