Is there some interface that will allow for iteraction of arrays and java.util.Lists?
Seeing as how the for-each loop can iterate both it seems to me there must be some sort of base 'iterable' that is being traversed in both cases.
So, can i setup a method parameter that accepts either Foo[], or List?
We have lots of old code (which we won't be updating), that calls a few low level methods (which i'd like to update) that are expecting arrays.
Our new code is converting from Lists (specifically ArrayLists most of the time) to arrays using List's toArray method, and i'd like to be able to skip this step.
I've seen this post which shows the implementation, but I'm not sure how it might help.
Can this be done?