There's one thing you need to know before you answer the question.
In Java, an array is an object. It does not create on the stack, such as c/c++.
In other words, the array elements are stored in the heap, and the starting address of the elements is stored in the stack.
So you're using 24 bytes for the hip.I don't think so. The type, length, and gc of the array will also be stored. So it's hard to know how much space you're going to use in the heap.
© 2024 OneMinuteCode. All rights reserved.