Except when it isn't.
An important difference is that any class (or interface) declared inside an interface is
implicitly static. This means it is
not an inner class, by
Java's definition of the term - because an inner class is not static. It is a static nested class, or static member class. Key differences are:
Static member class:
- has no reference to any enclosing class instance, because there isn't one
- can declare new static members
Inner (non-static) member class:
- has a reference to the enclosing class instance, if there is one
- cannot declare new static members (though it can inherit them)