I am learning about type erasure. I know that after type erasure the generic types become either object or upper bound. But if the generic types become object is the type safety not lost?
For eg the in the below example:-
List<String> a = new ArrayList<String>();
a.add(10) // I can't do this, but after type erasure the generic type becomes object so where is
the check for the type?
Any help is appreciated