I'm working in java.
I have an ArrayList<foo> myList and i try to convert it into an array.
Foo[] myArray = (Foo[])myList.toArray();
In eclipse i'm getting the error object cannot be cast to foo.
Any solutions? I'm trying to use a dynamic allocated matrix an an ArrayList is not sufficient because i have to apply some sorts.