Getting confused with Reference Casting and Widening w.r.t Objects in java
<p>With primitives and their Wrappers I understood the concept of Widening. But with respect to other Objects I am getting confused with Widening and implicit Casting. As example</p>

<pre><code>       Class Animal{
        }

        Class Dog extends Animal{

         public static void main(args String[]){

         Dog d = new Dog();
         d.go(d);
        }

       void go(Animal a){    }
      }
</code></pre>

<p>Edit: the question is which one is preferred widening or casting and why?</p>
