3 ms·
Did you mean arrays instead of lists? Arrays behave as you describe (with ArrayStoreException when you write a wrong value to an array). List<> is invariant WRT
by moring 8mo ago
Did you mean arrays instead of lists? Arrays behave as you describe (with ArrayStoreException when you write a wrong value to an array). List<> is invariant WRT its type parameter.
- hmry 8mo agoYeah, sorry, you're right. I have edited my comment. Thanks for the correction!