I created a class MyList that has a field
private LinkedList<User> list;
for(User user : myList) { //do something with ...
Say, I have two references to an Object in a LinkedList List1:
LinkedList<Object> List1 = new LinkedList<Object>(); Object first; Object last;
if I use a for-each loop on a linked list in java, is it guaranteed that I will iterate on the elements in the order in which they appear in the list?
I am working on an application which has some legacy code. Here, there is a linkedlist and the code iterates that linklist using an iterator in a while loop.
...