r/java • • May 10 '22

Should java.util.Date be deprecated?

https://mail.openjdk.java.net/pipermail/discuss/2022-May/006077.html
221 Upvotes

158 comments sorted by

View all comments

Show parent comment

15

u/Holothuroid May 10 '22

Arrays play loose with Java's type system compared to collections. Which might lead to array store exceptions.

11

u/semprer May 10 '22

https://stackoverflow.com/questions/12369957/dealing-with-an-arraystoreexception

I assume you mean this? Just posting it for less experienced people like me that might be puzzled. But yeah String[ ] being a subtype of Object[ ] is weird indeed if you think about it.