I'm trying to understand the java compiler generics types erasure with the following exemple. Can someone explain me why can i add a new motor bike into a list of Car ?
List<Vehicle> list = (List<Vehicle>)(Object)new ArrayList<Car>();
list.add(new MotorBike());