Java - For Loop

for(int i = 1; i < 6; i++) {
    System.out.println(i);
}

Will produce:

1
2
3
4
5


Enhanced for loop:

List<Integer> list = new ArrayList();

    list.add(1);
    list.add(2);
    list.add(3);
        
    for (Integer i : list) {
       System.out.println(i);
    }


Will produce:

1
2
3