Please the read the question instead of assuming this is a duplicate.
In the codebase I am working on I have a list of Foo objects:
private List<Foo> fooList;
Could someone please explain to me the difference(s) between this line of code:
Foo foos[] = fooList.toArray(new Foo[fooList.size()]);
and this line?
Foo foos[] = (Foo[]) fooList.toArray();