This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
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
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.
"JavaRanch, where the deer and the Certified play" - David O'Meara
Joined: Jan 16, 2001
Thank to both of you for your replies which sufficiently suffices my querry. Kind wishes Rashid Ali