I am programming for a memory-constrained device. Hence, I want to avoid allocating any memory.
Obviously, iterating across sets, lists, etc will allocate an iterator and thus allocate memory. So this should be avoided.
Does the native java syntax for iterating across arrays allocate memory?
Object[] array = getArray()
for(Object elem: array){
//do something
}
(I suppose I could always use the old-fashioned for loop with an index variable.)