logoalt Hacker News

moringyesterday at 11:38 AM1 replyview on HN

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.


Replies

hmryyesterday at 11:42 AM

Yeah, sorry, you're right. I have edited my comment. Thanks for the correction!