Originally Posted by
bugger
Thanks Tim. It means both can only store ArrayLists. Even arrayList1 cannot store other collections. Is this so?
That is not true. arrayList1 can store any instance of Collection, but arrayList2 can only store instances of ArrayList or any subclasses of it. For example:
Collection <String> test1 = null;
ArrayList <String> test2 = null;
The following is okay
test1 = new ArrayList<String>();
test1 = new Vector<String>();
test2 = new ArrayList<String>();
The following is NOT okay
test1 = new Integer(10);
test2 = new Vector<String>();
These are polymorphism concepts. I am sorry if I confused you.

I'm trying my best to explain this.