title: what is dynamic method resolution
body: <p>I am currently reading Herbert Schildt <em>"Java the Complete Reference"</em> and there he has used a term "Dynamic method resolution" and has provided a little explanation, but i am not getting the full import of it so asking for help in this forum.</p>
  
  <p>while discussing 'interfaces', what he is saying is, dynamic method resolution helps in resolution of method name at run-time and it is achieved by declaring a interface variable and using it to refer to a class object. i.e</p>
  
  <pre><code>        interface i = new object();
  </code></pre>
  
  <p>now what is so unique about it? you can use a class variable also to refer to the same object like:</p>
  
  <pre><code>        class c = new object(); 
  </code></pre>
  
  <p>so, what is the use of interface here? and why introduce this new term "dynamic method resolution"??</p>
  
  <ol start="2">
  <li><p>Second he makes a point by saying: " when we use an interface variable to refer to instance of any class, and when you call a method through these interface variables, the method to be executed is looked up dynamically at run time <strong>allowing classes to be created later than the code which calls method on them.</strong> The calling code can dispatch through an interface without having to know anything about the callee". </p>
  
  <p>Now, Anything dealing with objects has to be in run-time as objects are created at runtime, Now, I dont understand what he meant by "allowing classes to be created...on them".</p></li>
  </ol>
  
  <p>Any help will be appreciated. </p>