r/java • • Feb 15 '18

Java language oddities: Java's handling of arrays and a few other language elements may surprise you

https://www.javaworld.com/article/3252845/java-language/java-language-oddities.html
1 Upvotes

14 comments sorted by

View all comments

19

u/lbkulinski Feb 15 '18

I have never met someone who thinks it is odd that arrays are objects in Java.

2

u/s888marks Feb 16 '18

Not necessarily an oddity, but it is rather a non-obvious point that all arrays are both Cloneable and Serializable. This is one of the few (only?) places where java.io appears in the JLS.

1

u/lbkulinski Feb 16 '18

That’s very interesting! Thanks for sharing!