I hava implemented a generic arraylist with
public Object[] toArray()
{
return elementData;
}
to be able to sort it later. When i try to get the elements out
ArrayList<Integer> list = new ArrayList<Integer>();
list.add(10000);
list.add(1000);
list.add(100);
list.add(10);
list.add(1);
Object[] a = list.toArray();
for(Object o:a)
{
System.out.println(a);
}
it prints "[Ljava.lang.Object;@2a139a55" and such things, however the runtime type must be Integer here, isn't it?