Generic List and static variable behaviour in c#
<p>I have a simple application in C#. When I ran the code I am not getting the expected result?.I am getting 2,2,1 but i was expecting 1,2,3</p>

<pre><code>using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication12
{
    class Program
    {
        static void Main(string[] args)
        {
            MyList&lt;int&gt; list1 = new MyList&lt;int&gt;();
            MyList&lt;int&gt; list2 = new MyList&lt;int&gt;();
            MyList&lt;double&gt; list3 = new MyList&lt;double&gt;();
            Console.WriteLine(list1.GetCount());
            Console.WriteLine(list2.GetCount());
            Console.WriteLine(list3.GetCount());
        }
    }
    public class MyList&lt;T&gt;
    {
        static int _count;
        public MyList()
        {
            _count++;
        }
        public int GetCount()
        {
            return _count;
        }
    }
}
</code></pre>
