I'm not sure if this question has been asked before but here I go.
class Program
{
protected int ID;
static void Main(string[] args)
{
var Obj = new Program();
Obj.Inc();
Console.WriteLine(Obj.ID);
Console.ReadLine();
}
public int Inc()
{
return ++ID;
}
}
output: 1
The problem is this, when I run it again, shouldn't my output be 2, but I keep getting 1 every time I run the program.