This week's book giveaway is in the Security forum.
We're giving away four copies of Securing DevOps and have Julien Vehent on-line!
See this thread for details.
Win a copy of Securing DevOps this week in the Security forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

HashMap Doubt  RSS feed

 
Ranch Hand
Posts: 1083
Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
Sheriff
Posts: 57909
178
  • 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: 1083
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?
 
Bartender
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: 57909
178
  • 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.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!