Using ArrayList as a parameter
hey guys, so ive done this before but it doesnt seem to be working and i have no idea why. heres the code ive got:
public static void main(String[] args)
{
ArrayList<Collection> collections = new ArrayList<Collection>();
}
public static void selectionChoice(String selection)
{...some code not causing problem...
if(selection.equals("P"))
printListDetails(collections);
else if(selection.equals("E"))
listEmpty(collections);
public static void printListDetails(ArrayList<Collection> collections)
{...more code
public static boolean listEmpty(ArrayList<Collection> collections)
{...more code
of course, ive got a class called Collection with a constructor and various methods etc.
but when i compile it says
cannot find symbol
symbol: variable collections
location class ...
printListDetails(collections);
with a ^ pointing to collections
why cant i allow to use the arraylist as a parameter?