• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Where is the Methods place in Memory ?

 
Rashid Ali
Ranch Hand
Posts: 349
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would like to know that where in memory the static and non-static methods and other class members such as instance, static and non-static variable lies.
Could anybody let me know please.
Kind regards
Rashid Ali
 
Bosun Bello
Ranch Hand
Posts: 1511
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
They are placed in an area of the memory called the "Heap".

Bosun
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Variables are kept in stacks, an area separate from the heap. There is a separate stack for each method invoked for local variables. Constants are kept in a Constant pool which may be implemented in the heap (JVM dependant).
There is a method area on the heap that keeps both static and non-static methods. Objects (instances of classes) are kept on the heap.
 
Rashid Ali
Ranch Hand
Posts: 349
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank to both of you for your replies which sufficiently suffices my querry.
Kind wishes
Rashid Ali
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic