This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
I get a compilation error -> The method copy(List<? super T>, List<? extends T>) in the type Collections is not applicable for the arguments (List<String>, List<Object>)
what does List<? super T> & List<? extends T> signifies... i am simply copying from List<String> to List<Object> which is in my terms a more distinct hierarchy to the most generic Object list which Java should allow?
Joined: May 31, 2011
My mistake.. it should have been Collections.copy(copyList,testList);
You declared it with a big capacity (the number of elements it can hold before its internal structure needs to change). The size (the actual number of elements) is still 0. You'll first need to add several objects before the size increases.