- waste of memory space
- loss of data
- overlapping of existing data
In any programming language we have 2 types of memory allocations.
- Static Memory allocation
- Dynamic Memory allocation
A Static memory allocation is one in which memory will be allocated at compile time. Because of static memory allocation we get the following disadvantages.
- Waste of memory space[ no of values we entered at runtime are less than the size of the array]
- Loss of data [ no of values we entered at runtime are more than the size of the array]
- Overllapping of existing data.
To eliminate the above drawbacks we use dynamic memory allocation technique.
A dynamic memory alocation technique is one which memory will be allocated at runtime.
Java programming never follows static memory allocation but it will always follows dynamic memory allocation by using ‘new’ operator.
‘New’ operator is known as dynamic memory allocation operator.
Therefore, based on the memory allocation, SUN Microsystem has populated JAVA is one of the dynamic programming language.