I have a quick question that I am a little unclear which is the better practice.
Say I have a collection, c, that holds the numbers 3, 5, and 8.
Collection<Integer> c = new ArrayList<Integer>();
c.add(3);
c.add(5);
c.add(8);
I understand the idea of a for-each loop, however I am unclear on one part.
Do I write: for(Integer i: c){}
or for(int i: c)
?
If possible, please comment on speed, efficacy, advantages, and disadvantages or each.