Can someone please explain what is meant by the following statement :
Creation of arrays with a non-reifiable component type is not permitted.
This is written in Anjelika Langer's Java Generics FAQ
Creation of arrays with a non-reifiable component type is not permitted.
in practice means that generic array creation is illegal:
new T[...] // prohibited
Generic arrays are not allowed, because arrays contain information about its component at runtime. This is not true for generics. Generics are implemented at compiler level. Hence, the component type must be known beforehand when the array is created.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With