where the memory allocation happen for hard coded array elements
Memory allocation of hard coded array
Hi Aman
When you create just the array only a reference of the array is created. You can hard code the elements yourself or insert it via input.
As array is also an object it is stored in the same way as other objects in the heap area of the memory.However array allocation is contiguous( all elements of the array should be present one after the another).