0
I dont understand this for loop
LinkedList<String> c = new LinkedList<String>(); c.add("Red"); c.add("Blue"); c.add("Green"); c.add("Orange"); c.remove("Green"); for(String s: c) { System.out.println(s); } /* Output: Red Blue Orange */ How does it know to check each string and how does it know to start and stop?
1 Answer
0
loop foreach, read only forward the items