Hello bugger.
arrayList1 and arrayList2 are both instances of ArrayList, but they are of different type. arrayList1 can contain a Collection object. Although arrayList1 is actually an ArrayList, the compiler will see it as an object of type Collection. To use arrayList1 as an ArrayList you must first cast it. arrayList2 is an object of type ArrayList and no cast is necessary. But, in essence they are both still ArrayList objects.
Does that help?
