My question, is, whether the sequence of elements picked from a list will always be the same,
is this construction behaviour is deterministic for
java "List"s - descendants of java.util.List
2) question, if I use for(Object o: list) construction and inside the loop's body increment a variable,
will it be the index of list's elements? So, how it goes through list's elements, from 0 to size()-1 or chaotically?
List.get(i)
will always return this element?
3) question ( I suppose for the 2-nd question the answer will be negative, so:)
for (int i=0; i < list.size(); i++) {
}
is the best way if I need to save the index of an element and later get it back from a list by its id?