The code will compile and run. The cast in 'fido = (Dog)anim;' is required, because changing an Animal to a Dog is going down the tree.