C# incrementing static variables upon instantiation <p>I have a bankAccount object I'd like to increment using the constructor. The objective is to have it increment with every new object the class instantiates.</p> <p>Note: I've overriden the ToString() to display the accountType and accountNumber;</p> <p>Here is my code:</p> <pre><code>public class SavingsAccount { private static int accountNumber = 1000; private bool active; private decimal balance; public SavingsAccount(bool active, decimal balance, string accountType) { accountNumber++; this.active = active; this.balance = balance; this.accountType = accountType; } } </code></pre> <p>Why is it that when I plug this in main like so:</p> <pre><code>class Program { static void Main(string[] args) { SavingsAccount potato = new SavingsAccount(true, 100.0m, "Savings"); SavingsAccount magician = new SavingsAccount(true, 200.0m, "Savings"); Console.WriteLine(potato.ToString()); Console.WriteLine(magician.ToString()); } } </code></pre> <p>The output I get does not increment it individually i.e.</p> <pre><code>savings 1001 savings 1002 </code></pre> <p>but instead I get:</p> <pre><code>savings 1002 savings 1002 </code></pre> <p>How do I make it to be the former and not the latter?</p>