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.
If you want something with a fixed size, what's wrong with an array?
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Joined: Feb 04, 2010
fred rosenberger wrote:If you want something with a fixed size, what's wrong with an array?
Nothing wrong with an array, I am still trying to figure out how to use an array with ArrayList<Integer>.
The following has a compile time warning, which is the best solution.
How to fix it?
Type safety: The expression of type ArrayList needs unchecked conversion to conform to ArrayList<Integer>
The following will fail to compile:
Type mismatch: cannot convert from ArrayList<Integer> to ArrayList<Integer> ArrayListTest.java ArrayListTest/src