Why does the collection toArray() method return a simple Object array and not a array of the paramterized type?
One of the unfortunate consequences of implementing generics using erasure. At runtime the class doesn't know what type of array to create.
Your use of this web site or any of its content or software indicates your agreement to be bound by these Terms of Participation.
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.