Heap and stack are both memory area. The primitive data types are created on stach whereas objects are created on heap memory area. The stack stores the reference of an object (stored on heap).
Could you please explain the difference between Heap and Stack memory, Do we have any restriction on limitation on each of the memory type,View more random threads:
- Float datatype in java 2011
- WHAT IS PDA in java
- super.init(config) in java 2011
- Applet
- Java Error: <\bin\hotspot\jvm.dll> error message during...
- An unexpected error has been detected by HotSpot Virtual...
- how to install tomcat 6.0 inside the Java netbeans 6.8
- Event Handling in java
- Sir how can we make java ".class" file as .exe file. So...
- Java as Object-Oriented programming languge for students...
thanks
Sponsored Links
Heap and stack are both memory area. The primitive data types are created on stach whereas objects are created on heap memory area. The stack stores the reference of an object (stored on heap).
Stack is used for static memory allocation and Heap for dynamic memory allocation, both stored in the computer's RAM .
You can use the stack if you know exactly how much data you need to allocate before compile time and it is not too big. You can use heap if you don't know exactly how much data you will need at runtime or if you need to allocate a lot of data.
More about.......Stack and Heap
Helsy
Good to see that
Urgent call: 03455242488. | Virtual University Assignments
Virtual University GDBs | Virtual University Papers | Vu Projects | Vu Handouts
About Expert
There are currently 1 users browsing this thread. (0 members and 1 guests)