This week's book giveaway is in the OCAJP forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide 1Z0-808 and have Jeanne Boyarsky & Scott Selikoff on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes naming of an interface Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide 1Z0-808 this week in the OCAJP forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "naming of an interface" Watch "naming of an interface" New topic

naming of an interface

Sajid Moinuddin
Ranch Hand

Joined: Mar 19, 2005
Posts: 85
how come an interface can have a name like "Map.Entry"!!!??
(this is an interface in Collection framework... )

Glen Fernandes

Joined: Jan 28, 2005
Posts: 5
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).

wood burning stoves
subject: naming of an interface