What's the advantage of using an Array over an ArrayList? Is there any? Are Arrays faster? If there's no practical advantage, is there anything stopping me just using an ArrayList for
everything?
Plus, when using an enhanced for loop, is there any kind of special counter? Or would I have to use it like so:
int n = 0;
for (Object o:objectArray)
{
// Do stuff
n++;
}
I realise that the easy solution would be just to use the regular for-loop, but there are occassions when it's easier to use the enhanced for loop but I need some kind of counter too (for example, when using the loop to go through multiple related collections).
Thanks for you advice guys.