explicit casting from super class to subclass
<pre><code>public class Animal
{
  public void eat(){}
}
public class Dog extends Animal
{
  public void eat(){}
  public void main(String[] args)
  {
    Animal animal=new Animal();
    Dog dog=(Dog) animal;
  }
}
</code></pre>

<p>this code generates no compilation error(Dog dog=(Dog) animal;)...why compiler can't detect these error ..is this the drawback of compiler or is there any other reason..
but at runtime it generates classcastException</p>
