There are three main advantages of using the generic collection.
If we use the generic class, we don't need typecasting.
It is type-safe and checked at compile time.
Generic confirms the stability of the code by making it bug detectable at compile time.