You should read the book better. The code snippet you gave for D is not consistent with that in the book. In the book, sheep extends Plant, which solves sheep's problem, but doesn't compile because it breaks wolf's contract (carnivore)
and E will only compile if the class already compiles. It doesn't solve any problem with sheep.