C Sharp (C#) - Classes and Objects
What will be printed when the following C# program runs?
class Item {
public static int totalItems = 0;
public Item() {
totalItems += 1;
}
}
class Program {
static void Main() {
Item a = new Item();
Item b = new Item();
Item c = new Item();
Console.WriteLine(Item.totalItems);
}
}