Different ways to initialize an array of specified type

This is an empty vector of vectors, while Int[] is a vector of integers.

And [] is an empty vector of Any, which you then convert to Int[] in (b), which is why it allocates twice.

5 Likes