CSharp - Static Data in Generic Types

Introduction

Static data is unique for each closed type:

Demo

using System;

class Test<T>
{
    public static int Count;
}

class Test//from  ww w . j a va  2s . c o m
{
    static void Main()
    {
        Console.WriteLine(++Test<int>.Count);     // 1
        Console.WriteLine(++Test<int>.Count);     // 2
        Console.WriteLine(++Test<string>.Count);  // 1
        Console.WriteLine(++Test<object>.Count);  // 1
    }
}

Result