Rami Najjar wrote:what i can't understand how the last line MotherHippo class effect instanceof statement ?
For those without the book, note that MotherHippo isn't in the same code block as the other code you posted. It is after a sentence explaining why instanceof Mother compiles.
Java doesn't know what classes may implement other interfaces so the code has to compile. And then MotherHippo is the example showing an example where hippo instanceof Mother would be true.