RajivAwadhesh kumar wrote:Each object has its own values for instance variables. What about object's methods?
How and where are object's stored? How are the object's methods called from where the object is stored?
Please suggest any article or tutorial about how an object is made, stored and details of how instance variables, static members of a class and instance methods are stored?
The fact is: you don't need to know; and in many cases these details are JVM-specific, so any answer we give you for one might not be true on another.
Java is NOT like C or C++, where understanding how objects are arranged in memory can give you some insights into how to code. In Java it's more likely to (a) distract you from what you're supposed to be doing (ie, programming), and (b) lead you down the path to dangerously brittle code.
One thing I will tell you is that methods (both
static and non) are stored separately from object contents, and that usually only ONE copy of a method (again, both
static and non) is kept
per class...although when generics gets involved, I may not even be correct there.
Winston