using System;
class GC<T>
{
public void gm1()
{
Console.WriteLine("I'm from Generic Class");
}
public void gm2()
{
Console.WriteLine(23);
}
}
|
Class GC(Of T)
Public Sub gm1()
Console.WriteLine("I'm from Generic Class")
End Sub
Public Sub gm2()
Console.WriteLine(23)
End Sub
End Class
|
class Program
{
static void Main()
{
GC<string> ob1 = new GC<string>();
ob1.gm1();
GC<int> ob2 = new GC<int>();
ob2.gm2();
Console.ReadKey();
}
}
|
Class Program
Private Shared Sub Main()
Dim ob1 As New GC(Of String)()
ob1.gm1()
Dim ob2 As New GC(Of Integer)()
ob2.gm2()
Console.ReadKey()
End Sub
End Class
|