Unnamed
public text v1 · immutablepublic void addProduct(Product item)
{
int index = 0; //LCV
boolean found = false;
while(index < stock.size() && !found)
{
item = stock.get(index);
if(stock.contains(item))
{
found = false;
System.out.println("This ID has already been put in");
System.out.println("Please put in a different ID number");
}
else
{
index++; //increment
}
}
stock.add(item);
}