title: variable of Interface type
body: <p>I am learning Java, I saw the following description regards to <strong>interface</strong> in a book:</p>
  
  <blockquote>
    <p>When a variable is declared to be of an interface type, it simply
    means that the object is expected to have implemented that interface.</p>
  </blockquote>
  
  <p><strong>What does it mean?</strong> If I define an <strong>interface</strong>: </p>
  
  <pre><code>public interface Myinterface{
  
     void method_one(); 
     int method_two();
  }
  </code></pre>
  
  <p>Then, I declare a <strong>variable</strong> to be of an interface type for example:</p>
  
  <pre><code>Myinterface foo = new Myinterface();
  </code></pre>
  
  <ul>
  <li>How the interface get implemented?? </li>
  <li>Under what circumstance I should define a interface type variable? </li>
  </ul>
  
  <p>I completely get confused by the book's description...</p>