You are right it is a curious situation, but with some logic we can get out of this "paradox". The private signature forbidden any call outside the class it is defined, that's clear, and that's why anyway you cannot call from your ovrerridden method: because is private, it calls the "speak" method of the class the call is in. May be to make it more clear try to compare your code with
you will receive an error because speak() is private
To make it worthly work your code should look something like
now the oroginal method is protected, but it print out "My Frog is speaking..." as you expected because the method can be called outside the class it is defined.
The explanation could be - Case 1 : It is normal anonymous class behaviour, so doesnt require explanation. Case 2 : private methods cannot be overridden. And also note that the reference is actually of a parent Frog. Since the method is private, at run time the child anonymous inner is not even checked for a override. Case 3 : Here there is no parent reference and it is similar to calling the anonymous child inner method. Summing up - Its the reference Frog f that is making the difference.
subject: Inner and anonymous class method inheritance