Java – why does the enummap constructor need a class parameter?
•
Java
The enummap class constructor requires a class as an argument Most of the time, k.class is passed as a parameter I still haven't been accepted as an argument rather than a reason inferred from K
Thank you – PKC
Solution
Tom's answer is correct, but to solve your other point: this information can't be deduced only from the type parameter K because of type erasure
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码