title: Why do we store object in an interface reference?
body: <p>I have a doubt about interfaces.<br>
  I have seen some code,they are writing </p>
  
  <pre><code>Connection con = Drivermanager.getConnection("URL","User name","Pwd");
  </code></pre>
  
  <p>here con (reference varible of Connection Interface ) holding Oracle Connection Object.
  since we know that we are creating Oracle Connection Object why cant we write</p>
  
  <pre><code>OracleConnectionClass Oraclecon = Drivermanager.getConnection("URL","User name","Pwd");
  </code></pre>
  
  <p>if i asked some people they say that ,they are achieving polymorphism,by using Connection Interface.</p>
  
  <p>But,<br>
  what is the use.<br>
  we can do </p>
  
  <p>create statement,execute query.. etc by both references (con and Oraclecon).  </p>
  
  <p>simillarly for List and ArrayList<br>
  Thanks in advance</p>