Where do the method reside? For example,
class Foo {
public void foo_test(){}
}
Foo f1 = new Foo();
f1.foo_test();
(new Foo() {
public void singleton_test(){
foo_test();
}
}).singleton_test();
Do the methods reside in the class or the instances?
Does JVM do a method lookup (like C++ vtable)? How do the above 2 invocations of methods take place?
I was looking at this page:
http://docs.oracle.com/javase/specs/jvms/se7/html/jvms-5.html
But it only briefly explains the lookup procedure, not the place or any details.
This question is specifically related Oracle JVM.