It is always possible to create bizzarre, convoluted code and then ask "what's it's use"? However it's not necessarily worthwhile to anyone. To see a realistic example of when a nested interface can be used, look at the
Map interface, and the
Map.Entry nested within it. The only purpose for this Entry interface is to be used as part of a Map, so the authors thought it made sense to present the interface as part of the Map interface. They certainly
could have simply used a single separate Entry interface instead, but they chose not to. The idea is that when two classes or interfaces strongly related, we try to present them very close to each other (e.g. one nested in another).
The other way to look at this is, if they had said that you
couldn't define an interface nested within a class or interface, there would probably be people writing strange code and asking "why not"? This is one of those language features that could have been omitted, as we never really
need it - but there also doesn't seem to be a compelling reason to ban it, either. So you can always find people wanting to know "why" or "why not", and sometimes it really doesn't matter much either way. Maybe the engineers sometimes just tossed a coin to decide whether to allow some of these language features.