I found this searching SO:
Why should we declare an interface inside a class?
Thus, when dealing with some hierarchy, you can describe a “nested”
interface, which will be implemented by the wrapping class’s
subclasses.In the JDK, the most significant example would be Map.Entry inner
interface, defined within Map interface and implemented by various
ways by HashMap, LinkedHashMap etc…
1
solved What is this technique and why it is used for and how it works?