2015-04-20 15:36:01 -07:00
|
|
|
//: holding/SimpleCollection.java
|
|
|
|
import java.util.*;
|
|
|
|
|
|
|
|
public class SimpleCollection {
|
|
|
|
public static void main(String[] args) {
|
2015-05-05 11:20:13 -07:00
|
|
|
Collection<Integer> c = new ArrayList<>();
|
2015-04-20 15:36:01 -07:00
|
|
|
for(int i = 0; i < 10; i++)
|
|
|
|
c.add(i); // Autoboxing
|
|
|
|
for(Integer i : c)
|
|
|
|
System.out.print(i + ", ");
|
|
|
|
}
|
|
|
|
} /* Output:
|
|
|
|
0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
|
|
|
|
*///:~
|