Home Segments Top Top Previous Next

507: Mainline

The number of bytes allocated for each place in an array is determined by the type of the elements to be stored. If an array is to hold integers of type short, for example, Java allocates 2 bytes per integer. On the other hand, if an array is to hold integers of type int, Java allocates 4 bytes per integer.