Where do methods "live?"
<p>If each object has a different copy of instance variables, where do methods "live?"</p>

<p>As an example:</p>

<pre><code>class A {
    public foo() {
        System.out.println("foo");
    }
}

class B extends A {
    public foo() {
        System.out.println("foofoo");
    }
}

public class Main {
    public static void main(String[] args) {
        A a = new B();
        a.foo(); // "foofoo"
    }
}
</code></pre>

<p>I know that "foofoo" is printed. So are the methods bound to the objects or something?</p>
