What is the difference between generic collection and non generic collection in java?

Generic collections were introduced in Java 1.5 and since then have become preferable to non-generic collections. A non-generic collection defaults to being a collection of Objects, and in order to effectively use those Objects, you need to cast them as their correct data type during use. A generic collection knows what type of object it contains, and thus no casting is needed.