invoke : Java Glossary


To call a method. The JVM (Java Virtual Machine) has four different types of byte-code instructions for invoking a method. Ordered from slowest to fastest they are:
  1. invokeinterface:

    Used to call a method via an interface reference. Method is not at the same slot in each class.
  2. invokeinstance:

    Used to call an ordinary instance method. The method is potentially overrideable, so the JVM has to decide at run time which variant to use.
  3. invokespecial:

    Used to call a specific instance method, when the particular method is known at compile time, e.g. when the method is final,
  4. invokestatic:

    Used to call static methods. There is no object or this parameter to deal with.
Instead of using invokestatic or invokespecial, the compiler might expand the method inline for short methods.

This page is posted
on the web at:

Optional Replicator mirror
on local hard disk J:

Canadian Mind Products
Please the feedback from other visitors, or your own feedback about the site.
Contact Roedy. Please feel free to link to this page without explicit permission.

Your face IP:[]
You are visitor number