Tag: java dynamic

How Java is “Dynamic” ?

java-logo

Dynamic

  1. waste of memory space
  2. loss of data
  3. overlapping of existing data

In any programming language we have 2 types of memory allocations.
They are:

  1. Static Memory allocation
  2. 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.

  1. Waste of memory space[ no of values we entered at runtime are less than the size of the array]
  2. Loss of data [ no of values we entered at runtime are more than the size of the array]
  3. 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.

Advertisements