JAVA class hierarchy: Which of the following lines will not compile? : <p>Having the following class hierarchy:</p>

<pre><code>Interface Animal {…}
class Dog implements Animal{…}
class Poodle extends Dog {…}
class Labrador extends Dog {…}
</code></pre>

<p>Which of the following lines will not compile? </p>

<pre><code>Poodle poodle = new Poodle(); //1
Animal animal = (Animal) poodle; //2
Dog dog = new Labrador(); //3
animal = dog; //4
poodle = dog; //5
Animal labrador = new Labrador(); //6
Dog dog2 = new Labrador(); //7
dog 2=labrador;//8
</code></pre>

<p>I think line 5: because of poodle's and dog's static binding.</p>

<p>Line  8 : only static binding is relevant for an assignment  .</p>

<p>Am I right? May you give an explanation? </p>
