Several methods of memory allocation in Java

1、 Upper limit of array allocation

In Java, the size of array is limited because it uses int type as array subscript. This means that you cannot apply for more than integer MAX_ Value (2 ^ 31-1). This does not mean that the maximum memory you can apply for is 2G. You can apply for a larger type of array. For example:

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>