- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Where objects, methods and variables are stored in memory in Java?
There are five main memory areas which are used to various Java elements. Following is the list of the same.
Class Area - This area contains the static members of the class.
Method Area - This area contains the method definition and executable code.
Heap Area - This area contains the objects which are dynamically allocated/deallocated. if an object is no more referenced by any live reference it is deallocated.
Stack Area - This area contains the local variables.
Pool Area - Contains immutable objects like string.
- Related Articles
- How are Java objects stored in memory?
- How Java objects are stored in memory?
- Where are JavaScript variables stored?
- Where does Array stored in JVM memory in Java?
- How and where does String literals in Java stored in the memory?
- Where are static variables stored in C/C++?
- How (where) are the elements of an array stored in memory?
- What are native methods in Java and where are they used?
- Demonstrate static variables, methods and blocks in Java
- How are variables allocated memory in JavaScript?
- What are native methods in Java and where should we use them?
- Can we have variables and methods in an enum in Java?
- Declare static variables and methods in an abstract class in Java
- What are class variables, instance variables and local variables in Java?
- How to define expressions, variables, and methods in JShell in Java 9?

Advertisements