• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HashMap Doubt

 
Vishal Hegde
Ranch Hand
Posts: 1077
Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
Campbell Ritchie
Sheriff
Posts: 48652
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Vishal Hegde wrote: // here does entrySet adds all its items in a SET?
Not quite sure I understand your question.
The entrySet method creates a Set with all the entries in.
// Is Entry some static variable that adds the elements of set in a Map
No. It is an interface nested inside the Map interface.

Your post would be easier to understand if you wrote the questions outside the code tags.
Why have you not given the Map type parameters? It would be a lot easier to handle a Map<String, Integer>.
 
Vishal Hegde
Ranch Hand
Posts: 1077
Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No. It is an interface nested inside the Map interface..

Interface can be nested??

By that you mean is-a relationship ,right using extends keyword?
 
Wouter Oet
Saloon Keeper
Posts: 2700
IntelliJ IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No it's just an interface defined in another interface.

// Edit: Just to clarify. My no is the answer to the question: By that you mean is-a relationship ,right using extends keyword?
 
Campbell Ritchie
Sheriff
Posts: 48652
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Vishal Hegde wrote: . . . Interface can be nested??
Yes. Open the src.zip file in your Java™ installation folder and you can see how it is done
. . . By that you mean is-a relationship ,right using extends keyword?
No. Not at all.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic