title: Does JVM know what function pointers are?
body: <p>I'm reading J. Bloch's effective java and now I'm at the using function object item. He said that:</p>
  
  <blockquote>
    <p>Java does not provide function pointers, but object references can be
    used to achieve a similar effect. Invoking a method on an object
    typically performs some operation on that object. However, it is
    possible to define an object whose methods perform operations on other
    objects, passed explicitly to the methods. A<strong>n instance of a class that</strong>
    <strong>exports exactly one such method is effectively a pointer to that</strong>
    <strong>method.</strong></p>
  </blockquote>
  
  <p>What does that mean? I'd guess that everytime we create the object of such a class, we'll effectively get a function pointer within <code>JVM</code> internally. But I'm not sure about that, becauase Java itself doesn't know the function pointer concept. </p>
  
  <p>In other word, do we have just an optimization performed by compilers for such objects?</p>
  
  <p>Example:</p>
  
  <pre><code>public interface Callback{
       public void invoke();
  }
  
  public class GenericCallback implements Callback{
       public void invoke(){ System.out.println("Generic callback"); }
  }
  
  public static void main(String[] args){
      Callback c = new GenericCallback(); //What kind of optimization will 
                                          //be performed for the c object?
  }
  </code></pre>