If you are referring to appending data beyond the current end of the allocated array, you can’t do that in any language since the memory does not exist for you to write in. You have to use whatever mechanism exists in the given language to allocate the additional memory first. At the lowest levels this would result in the following:
1) Allocate new memory equaling the size of the existing block plus the additional space required
2) Copy the original data into the new memory location
Now you can append more elements (write data) into the additional memory space allocated.
In Java to copy arrays use the java.lang.System.arraycopy() function.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.