Can you pass an int array to a generic method in java?

后端 未结 6 2093
伪装坚强ぢ
伪装坚强ぢ 2020-12-03 16:01

I\'m playing around with some code katas and trying to get a better understanding of java generics at the same time. I\'ve got this little method that prints arrays like I l

6条回答
  •  天命终不由人
    2020-12-03 16:37

    You will probably have to wrap the primitives into corresponding collections.

    I also suggest to take a look to Trove primitive collections (http://trove.starlight-systems.com). This is unrelated to your generics question, but may be quite interesting.

提交回复
热议问题