creating array without declaring the size - java

后端 未结 6 1139
面向向阳花
面向向阳花 2020-12-13 16:29

i\'ve digging around about the same issue but i couldn\'t find the same as i had

i want to create an array without declaring the size because i don\'t know how it w

6条回答
  •  北海茫月
    2020-12-13 16:59

    You might be looking for a List? Either LinkedList or ArrayList are good classes to take a look at. You can then call toArray() to get the list as an array.

提交回复
热议问题