aspose file tools*
The moose likes Beginning Java and the fly likes meaning pf this code Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "meaning pf this code" Watch "meaning pf this code" New topic
Author

meaning pf this code

pras
Ranch Hand

Joined: Apr 04, 2007
Posts: 188
static class Entry implements Map.Entry {


/*********** can anyone explain this thing ****/

Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

It looks like the definition of an inner class (since top-level classes can't be declared static) called "Entry" that implements the interface Map.Entry.

What are you unsure about? Map.Entry is defined in the JavaDocs , do you not understand what this interface is for? Or are you unfamiliar with inner classes?


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
pras
Ranch Hand

Joined: Apr 04, 2007
Posts: 188
static class Entry implements Map.Entry {


if it was static class Entry implements Map i understand

what i am not getting is Map.Entry ?
which is the interface here Map or Entry?
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

The interface is Map.Entry. It is an interface defined in the Map class hence the slightly unusual form.
pras
Ranch Hand

Joined: Apr 04, 2007
Posts: 188
hi paul,

sorry if i sound silly but i thought Map was a interface?
shazar kv
Greenhorn

Joined: Mar 16, 2007
Posts: 7
Map is an Interface NOT a class defined in java.util package.Map.Entry is another Interface defined in the same package.

Map interface contains a method called entrySet() - Returns a set view of the mappings contained in this map..The return type of the method is Map.Entry.

The Map.entrySet method returns a collection-view of the map, whose elements are of this interface(Map.Entry)

Regards
Shazar
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: meaning pf this code