diff options
Diffstat (limited to 'java/10-collections/Test3.java')
| -rw-r--r-- | java/10-collections/Test3.java | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/java/10-collections/Test3.java b/java/10-collections/Test3.java new file mode 100644 index 0000000..57e5e47 --- /dev/null +++ b/java/10-collections/Test3.java @@ -0,0 +1,22 @@ +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +public class Test3 { + + /** + * @param args + */ + public static void main(String[] args) { + List<Customer> list = new ArrayList<Customer>(); + + list.add(new Customer("Nuwan")); + list.add(new Customer("Lasitha")); + list.add(new Customer("Praveen")); + + for (Customer c : list) { + // Do some work with c here + System.out.println(c); + } + } +} |
