Originally posted by Barkat Mardhani:
How can an interface include nested class. I thought interface is only a protocal that defines what will be in implementing classes, without any implementation in itself. If nested class in interface, it has to have implementation...
If you take a look at the JLS,
§9.5 Member Type Declarations you'll see:
Interfaces may contain member type declarations (�8.5). A member type declaration in an interface is implicitly static and public.
It's true that any methods defined within an Interface are implicitly abstract and therefore have no definition, but an Interface is also capable of containing a nested class. That class, on the other hand may have fully defined methods within it.
I hope that helps,
Corey