problem with update the counter value
- by Edan
Hello,
I having problem to update the counter (integer value).
this is the definitions of the class:
public class Item_Actions
{
private final int MAX_ITEMS = 100;
private Item myItem[];
private int counter;
public Item_Actions()
{
myItem = new Item[MAX_ITEMS];
counter++;
}
//Constructor add item into the menu (Description, type & price of Item)
public void addItem(Item itm)
{
myItem[counter] = itm;
counter++;
}.......
Now everytime I call the addItem constructor from another class, the counter always stays on zero.
What causing it and how do I save the data inside?
thanks