Then you might experience a compiler warning similar to the following one:
Type safety: The expression of type List needs unchecked conversion to conform to ListAs the compiler tries to statically check the type safety there is no way it can find out whether the raw type list actually contains only instances of YourType.
The solution is to add the following annotation in front of the method for which the warning is reported:
@SuppressWarnings("unchecked")Note that the generic ArrayList<> is always compiled into the raw type ArrayList. The same applies for all other collections in java.util. The reason is that this type information is removed in order to stay backward compatible. Therefore in Java 5 all instances of ArrayList
For C++ and also for .NET 2.0 and later the designers chose a different solution. In C++ each instance of the template ArrayList