Java increase array by X size

前端 未结 6 690
广开言路
广开言路 2021-01-27 21:04

I need an array that I can determine its size from the start and if it has no more empty spaces then increase its size by X. For example:

int arrayS         


        
6条回答
  •  忘掉有多难
    2021-01-27 21:20

    The only way to do this is by creating new array and copying data. However it is suggested that you use ArrayList instead.

提交回复
热议问题