How does the JVM search and call a method?

Where is the method located? For instance,

class Foo {
  public void foo_test(){}
}

Foo f1 = new Foo();
f1.foo_test();

(new Foo() {
  public void singleton_test(){
    foo_test();
  }
}).singleton_test();

Are methods used in the class or instances?

Does the JVM search for a method (e.g. C ++ vtable)? How are the above 2 method calls performed?

I looked at this page:

http://docs.oracle.com/javase/specs/jvms/se7/html/jvms-5.html

But he only briefly explains the search procedure, not the place or any details.


This question is specifically related to Oracle JVM.

+4
source share
1 answer

Java , , static. , , . ( .)

, . , , final, , .

+1

All Articles