Language Basics C# Book

We can use default keyword to get the default value for generic type parameter.

using System;
class Test
{
static void print(T t)
{
Console.WriteLine(default(T));
}
static void Main()
{
int i = 5;
print(i);
}
}
The output:
0