i am writing a a program that has two classes. the first class has an array which will be able to add the other class into its array with a length of 10. however i get the error saying "Cannot find Symbol". so my question is how do i add a seperate class to the array of an another class?
import java.util.ArrayList;
import java.util.Iterator;
import java.util.Arrays;
public class HomeInventoryManager
private int[] listOfInventoryItems;
/**
* Initialise the home inventory manager.
*/
public HomeInventoryManager()
{
listOfInventoryItems = new int[10];
InventoryItem = 0; **i get the error here saying it cannot find the symbol variable InventoryItem**
}
public void addInventoryItem()
{
listOfInventoryItems[InventoryItem] = anInt;
inventoryItem++;
}
