sorry i couldn't reply to any of you, and I realized the code I left was not compete, but i finally figured out what was wrong, it doesn't make sense to me but it did fix the problem, and the problem wasn't even in the method i posted.
originally I had (ArrayList Lamborghini) when i was initializing the inventory arraylist:
public class LamborghiniCarLot
{
private String lotName;
private ArrayList<Lamborghini> inventory;
public LamborghiniCarLot()
{
ArrayList<Lamborghini> inventory = new ArrayList<Lamborghini>();
}
public LamborghiniCarLot(String lotName){
ArrayList<Lamborghini>inventory = new ArrayList<Lamborghini>();
setLotName(lotName);
then I tried to remove the (ArrayList Lamborghini) before inventory and it fixed everything:
public LamborghiniCarLot()
{
inventory = new ArrayList<Lamborghini>();
}
public LamborghiniCarLot(String lotName){
inventory = new ArrayList<Lamborghini>();
setLotName(lotName);
It would be appreciated if someone can explain to me what that changed and why it wouldn't work with arraylist lamborghini before inventory. I am new to programming so please be detailed.