Declaring object of interface instead of implementation class
<p>I found this code which creates an object of the implementation class and assigning it to the interface class variable:</p>

<pre><code>Myinterface obj=new MyImplementationClass();
</code></pre>

<p>Why dont we just use</p>

<pre><code> MyImplementationClass obj=new MyImplementationClass();
</code></pre>

<p>?</p>
