You created a reference type c which can hold an arrayList of only Rectangle objects. But it is assigned to b, which is a arrayList of Object.So you can add any object, problem will come only when you try to get the object from the List and cast Circle object to Rectangle Object.
You are not assigning c to a, which is Arraylist of type Circle. So c can add a Circle Object.Use of Generic will prevent you adding a Circle object to a ArrayList of type Rectangle.
SCJP 5.0 -- 97%
This guy is skipping without a rope. At least, that's what this tiny ad said:
SKIP - a book about connecting industrious people with elderly land owners