Generics in C#


using
System;
namespace
Generic
{
class GenericClass<T>
{
public T Getvalue(T input)
{
T obj = input;
return obj;
}

}
public class Test
{
public static void Main()
{
GenericClass<int> objGeneric = new GenericClass<int>();
Console.WriteLine(objGeneric.Getvalue(5));
Console.ReadLine();
}
}
}
Ebook Download
View all
Learn
View all