File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

naming of an interface

 
Sajid Moinuddin
Ranch Hand
Posts: 85
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how come an interface can have a name like "Map.Entry"!!!??
(this is an interface in Collection framework... )


sajid
 
Glen Fernandes
Greenhorn
Posts: 5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Sajid,

Entry is static nested interface, inside interface Map.
This is almost like a static-nested class inside a class.

Consider the following code:


You can reference this via Outer.Inner, and even instantiate an object of an anonymous inner class, for example:


Simply put, a static nested interface behaves similarly to a static nested class - except it is an interface. (Technically it is not an "inner"-interface, just as static nested classes are not "inner"-classes).

Regards,
Glen
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic