Java generics. Explain why Java prohibits generic array creation.
to start, you need to understand that Java arrays are covariant but Java generics are not: that is, String[] is a subtype of Object[], but Stack is not a subtype of Stack.
Java generics. Explain why Java prohibits generic array creation.
to start, you need to understand that Java arrays are covariant but Java generics are not: that is, String[] is a subtype of Object[], but Stack is not a subtype of Stack.