Bilal is correct. From
JLS2 8.5.2: "Member interfaces are always implicitly static. It is permitted but not required for the declaration of a member interface to explicitly list the static modifier." We're not saying that the methods in the interface are static (which is false), or that fields in an interface are static (which is true). We're saying that the nested interface itself is static. Static in the sense of "static nested class" (or interface, rather).
[Edwin]: There is a principle that says the "non-static inner classes cannot have static members". Inner classes cannot
declare static members (where members includes methods, fields, and nested types). They can however
inherit static members from a superclass (or superinterface).
And there is another principle that says "interfaces are static by default". Nested interfaces are implicitly static. It's not just the default for nested interfaces - they're static, period, and we can't possibly change that.
That made me wonder if it was possible that an inner non-static class have an interface declaration. Strangely the code you see below compiled in JDeveloper 10g (Preview Edition), but not in the command line... at the end the JDeveloper compiler threw a compiler internal error.
But, what can I learn from all this? Is it, or is it not possible to declare an interface in a non-static inner class? No, it isn't. Sounds like this was a bug in JDeveloper.
[ January 30, 2005: Message edited by: Jim Yingst ]