I'm making a game using Java. I'm a beginner programmer. This is a fantasy RPG like game. The game is coming along and I'm about to undertake an inventory system. There are shop owners and these owners are going to have limited inventory. I am still learning about memory management and consumption so my question is as follows.
If Laurel is the shop owner, would the most efficient way to keep track of Laurel's 10 potions be something like
static int laurelInventory = 10;
And then when the Hero buys a potion it would be simply:
laurelInventory = laurelInventory - qtyPurchased;
What I'm trying to understand is will I run into trouble using static very frequently, or is there a better way to store running counts and totals. This makes it a lot cleaner for me as opposed to worrying about the instance I created and managing that instance.
Also +1 for any additional ruminating on memory management