A
Adam
Hi all,
I have an arraylist filled with 4 objects and defined as shown below.
ArrayList items = new ArrayList();
public Item GetItemAt(int index)
{
return (Item)items[index];
}
Problem is, no matter what value I provide for "index", it always returns
the LAST item in the ArrayList.
I feed it index 0, 1, 2, or 3 and it always returns Item at index 3.
I'm confused. Any tips would be greatly appreciated.
Thanks!
I have an arraylist filled with 4 objects and defined as shown below.
ArrayList items = new ArrayList();
public Item GetItemAt(int index)
{
return (Item)items[index];
}
Problem is, no matter what value I provide for "index", it always returns
the LAST item in the ArrayList.
I feed it index 0, 1, 2, or 3 and it always returns Item at index 3.
I'm confused. Any tips would be greatly appreciated.
Thanks!