"One more thing to keep in mind about anonymous interface implementers—they
can implement only one interface. There simply isn't any mechanism to say that
your anonymous inner class is going to implement multiple interfaces. In fact, an
anonymous inner class can't even extend a class and implement an interface at the
same time.
The inner class has to choose either to be a subclass of a named class—
and not directly implement any interfaces at all—or to implement a single interface.
By directly, we mean actually using the keyword implements as part of the class
declaration. If the anonymous inner class is a subclass of a class type, it automatically
becomes an implementer of any interfaces implemented by the superclass."
K&B2008, pg 678.
What I think is as follows.
In your case, first of all, you have Ranch (Interface) separately extend Range (Interface) and Grassland (Interface). In Feed class, there is a definition of an implementer of Range interface which is anonymous. So, that is fine as the anonymous one DIRECTLY implements only one interface (Range). The same goes to the second anonymous implementer (of Grassland interface). Thus, everything is fine until line 28 of your second version of code.
Then you create an instance of a new implementer of Ranch which already has the obligations of three interfaces (Range, Grassland and Ranch itself). So, in this case, even though anonymous Ranch implementer has to implement all three abstract methods in all three interfaces, what it is currently doing is just DIRECTLY implementing ONLY ONE interface (Ranch). Again, everything is fine until line 36 and the idea of one direct implementer still holds true.
Next comes the anonymous subclass of Feed (Feed = implementer of Ranch). In this case, eat() and munch() methods overrides the version of methods in the Feed class itself and the anonymous class also has a method of its own (homo()). This anonymous class too is DIRECTLY extending ONLY ONE class without DIRECTLY implementing another interface apart from OVERRIDING some methods (from the interfaces) of the Feed class.
Therefore, in all cases, Ranch anonymous implementer and Feed anonymous subclass DIRECTLY implements ONLY ONE interface or DIRECTLY extends ONLY ONE superclass respectively. The others are all because of the interface the anonymous one implement or the superclass the anonymous one extends.
Harry: Sorry for my long text and sorry if the explanation make you confused.
Senior ranchers: If I am wrong in something, please correct.
Thank you.