I want to know how Java allocates memory for arrays: Is it contiguous or non-contiguous?
Please give me a suitable example which proves it.
I want to know how Java allocates memory for arrays: Is it contiguous or
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The Java specs do not require either choice, and in fact do not offer any way of observing either choice.
If I write a JVM in Javascript, for example, arrays would probably be non-contiguous.
That said, I would strongly assume that most actual JVMs do use contiguous memory.