1. You are casting Hound to a Dog. Dog does not have a sniff() method. The compiler at this point only knows about Dog so it complains.
2. A Redwood IS A Tree. But a Tree IS NOT A Redwood. You are telling the compiler that a Tree is a Redwood so it believes you. The JVM knows you are lying.
i get the compiler error when javac notices that there is no sniff() method on Dog. On the other hand, i get a ClassCastException when the casting itself is wrong...