Java generics. Explain why Java prohibits generic array creation.

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/u014110320/article/details/77678024

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.

猜你喜欢

转载自blog.csdn.net/u014110320/article/details/77678024