I don't believe either of you have tried.
Do so. You can indeed create a class inside an interface. If you consult the
JLS, you will find that such a class is implicitly static, and public. So it's a static member class, even if it wasn't declared as such. What's it good for? Good question - I suppose it's tied to "what are atatic member classes good for in general?" Offhand, I suppose I might use it to define exception classes associated with the interface I am designing:
<code><pre>
interface Parser {
parse(File input) throws Parser.Exception;
class Exception extends java.lang.Exception {
// some methods
}
}</pre></code>
Now I'm not arguing that's particularly useful, but it's legal.
[This message has been edited by Jim Yingst (edited July 10, 2001).]