How does memory allocation of an ArrayList work?

后端 未结 5 1636
遇见更好的自我
遇见更好的自我 2021-02-01 02:49

As far as I know, when we are creating an ArrayList:

ArrayList list = new ArrayList(SIZE);

The JVM res

5条回答
  •  广开言路
    2021-02-01 03:49

    I assume it will run out of memory since there will be no space to use in the case where JVM can extend array size.

提交回复
热议问题