How can I declare dynamic String array in Java

后端 未结 5 948
南方客
南方客 2021-02-01 05:09

I am using String Array declare as zoom z[]=new String[422];. But this array stores value from 0 to 32, so I got null pointer except

5条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-02-01 05:48

    no, there is no way to make array length dynamic in java. you can use ArrayList or other List implementations instead.

提交回复
热议问题