| Author |
HashMap Doubt
|
Vishal Hegde
Ranch Hand
Joined: Aug 01, 2009
Posts: 973
|
|
|
|
http://www.lifesbizzare.blogspot.com || OCJP:81%
|
 |
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 32712
|
|
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
Joined: Aug 01, 2009
Posts: 973
|
|
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
Joined: Oct 25, 2008
Posts: 2700
|
|
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?
|
"Any fool can write code that a computer can understand. Good programmers write code that humans can understand." --- Martin Fowler
Please correct my English.
|
 |
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 32712
|
|
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.
|
 |
 |
|
|
subject: HashMap Doubt
|
|
|