Advertisements
Advertisements
प्रश्न
What is the difference between static and dynamic allocation?
अंतर स्पष्ट करें
Advertisements
उत्तर
| Static Allocation | Dynamic Allocation |
| Memory is allocated at compile time. | Memory is allocated at runtime. |
| The size of memory is fixed and cannot be changed during execution. | The size of memory can be changed during execution as required. |
| It is faster but less flexible. | It is more flexible but may be slower. |
| Example: Normal array declaration int a[10]; | Example: Dynamic memory allocation using objects in Java like new int[10]; |
shaalaa.com
क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
अध्याय 7: Arrays - One Dimension - Exercises [पृष्ठ १७४]
