I'm trying to understand the type inference and the use of diamond operator.
Assuming that RaceCar
is a subclass of Car
, which is a subclass of Vehicle
what kind of objects can be added to the following collection?
List<Car> list = new ArrayList<>();
I found What is the point of the diamond operator in Java 7? question, but still don't get it.
Thank you in advance!
LE: it's important to know how inheritance works in this case