How to do a C-style initialization of a variable

The only reason I use clone is when I have to copy arrays.

byte[] data = new byte[1234]; data[13] = 14; byte[] copy = data.clone();

Yeah, I’ve used it with List’s as well, but in the end that’s the same basic idea. I actually didn’t know you could clone an array.

The really cool bit is that since 1.5 introduced covariant return types they’ve been applied to most (all?) Cloneables in the standard libraries, including arrays, so Riven’s example works even though it has no cast.

That’s cool. They’re slowly getting out of having to typecast everything all the time territory. Those were the (1.4) days… I would have statements with like 6 parentheses next to each other.