From Java util. List get class

How to get Java. Net from this expression util. Get class from list

Solution

I assume that you want to know the template class of list at run time. The short answer is: you can't Java generics are used only at compile time: template parameters are erased before generating bytecode This is called "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
分享
二维码
< <上一篇
下一篇>>