Bear Bibeault wrote:let me ask it this way: how does it not make sense?
Rauhl Roy wrote:there are 2 versions of same methods available (that is in Map) in the LinkedHashMap 1 from HashMap + 1 from Map
Bear Bibeault wrote:
Rauhl Roy wrote:there are 2 versions of same methods available (that is in Map) in the LinkedHashMap 1 from HashMap + 1 from Map
Really? Is that what an interface means?
Think about it.
Bear Bibeault wrote:The interface merely declares what methods are available -- it says nothing about the implementation. So having the interface on two classes in the hierarchy introduces no ambiguity.
It's like if a person says: "I'm a police officer. I'm a police officer." Just because he said the same thing twice doesn't mean there's more than one police officer.
Bear Bibeault wrote:My point is there is nothing to be ignored. The same interface is being referenced. But it's the same interface, so there's not ambiguity.
Rauhl Roy wrote:what is the use of LinkedHashMap implements Map?
Paul Clapham wrote:
Rauhl Roy wrote:what is the use of LinkedHashMap implements Map?
One use of that is this:
Rauhl Roy wrote:very good answer but can you please give any thing in terms of functionality usage?
Paul Clapham wrote:
Rauhl Roy wrote:very good answer but can you please give any thing in terms of functionality usage?
I don't think so. For one thing I don't understand what "functionality usage" means.
Rauhl Roy wrote:but any other use other than the one you mentioned above?
Paul Clapham wrote:
Rauhl Roy wrote:but any other use other than the one you mentioned above?
That is what it means for a class to implement an interface.
Rauhl Roy wrote:so LinkedHashMap is implementing Map interface for object reference purpose?
Paul Clapham wrote:
Rauhl Roy wrote:what is the use of LinkedHashMap implements Map?
One use of that is this:
Ankur Kapoor
Bear Bibeault wrote:The interface merely declares what methods are available -- it says nothing about the implementation. So having the interface on two classes in the hierarchy introduces no ambiguity.
It's like if a person says: "I'm a police officer. I'm a police officer." Just because he said the same thing twice doesn't mean there's more than one police officer.
Piyush
Ankur Kapoor
Thanks tiny ad, for helping me escape the terrible comfort of this chair.
Clean our rivers and oceans from home
https://www.kickstarter.com/projects/paulwheaton/willow-feeders
|