title: How are instance methods stored
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/8204595/java-c-method-representation-in-memory">Java/C# method representation in memory</a>  </p>
  </blockquote>
  
  
  
  <p>I was wondering if i have an object in java, how are it's instance methods stored? Does an object have a pointer to it's instance methods?</p>
  
  <p>Example:</p>
  
  <pre><code>public class MyObject {
   private int x;
   private int y;
   [..]
  }
  </code></pre>
  
  <p>If i plan keeping a lot (A big tree of objects for example) of these <code>MyObject</code>s in memory, will it make a significant difference in  memory terms if apart from a getter for x and for y i define an instance method calculating the sum?</p>
  
  <p>I'm trying to sort out wether i should add more instance methods or doing the calculations in another class using the getters and setters.</p>