Adding integers to an int array

前端 未结 7 850
我在风中等你
我在风中等你 2021-02-05 01:57

I am trying to add integers into an int array, but Eclipse says:

cannot invoke add(int) on the array type int[]

Which is completely

相关标签:
7条回答
  • 2021-02-05 02:32

    org.apache.commons.lang.ArrayUtils can do this

    num = (int []) ArrayUtils.add(num, 12);     // builds new array with 12 appended
    
    0 讨论(0)
提交回复
热议问题