What's the reason Java doesn't allow us to do
private T[] elements = new T[initialCapacity];
?
I could understand .NET didn't allow us to do that, as in .NET you have value types that at run-time can have different sizes, but in Java all kinds of T will be object references, thus having the same size(correct me if I'm wrong).
What is the reason?