queue 2
Queue<String> queue = new LinkedList<>();
queue.add("element 0");
queue.add("element 1");
queue.add("element 2");
//access via Iterator
Iterator<String> iterator = queue.iterator();
while(iterator.hasNext(){
String element = iterator.next();
}
//access via new for-loop
for(String element : queue) {
//do something with each element
}