Restricting the Object Type for the get method in java HashMap Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Data science time! April 2019 and salary with experience The Ask Question Wizard is Live!Does a finally block always get executed in Java?Fastest way to determine if an integer's square root is an integerA Java collection of value pairs? (tuples?)How to get an enum value from a string value in Java?Java Hashmap: How to get key from value?get string value from HashMap depending on key nameHow to update a value, given a key in a java hashmap?java.lang.OutOfMemoryError: GC overhead limit exceededConvert object array to hash map, indexed by an attribute value of the ObjectRestrict HashMap to accept a particular string key

What helicopter has the most rotor blades?

The Nth Gryphon Number

Pointing to problems without suggesting solutions

What does 丫 mean? 丫是什么意思?

Where and when has Thucydides been studied?

Can two people see the same photon?

Was the pager message from Nick Fury to Captain Marvel unnecessary?

Where did Ptolemy compare the Earth to the distance of fixed stars?

3D Masyu - A Die

Is there a spell that can create a permanent fire?

Can I cut the hair of a conjured korred with a blade made of precious material to harvest that material from the korred?

Marquee sign letters

Why complex landing gears are used instead of simple, reliable and light weight muscle wire or shape memory alloys?

Why are current probes so expensive?

What should one know about term logic before studying propositional and predicate logic?

Found this skink in my tomato plant bucket. Is he trapped? Or could he leave if he wanted?

How to show a density matrix is in a pure/mixed state?

Restricting the Object Type for the get method in java HashMap

Is the Mordenkainen's Sword spell underpowered?

What did Turing mean when saying that "machines cannot give rise to surprises" is due to a fallacy?

Flight departed from the gate 5 min before scheduled departure time. Refund options

Why can't fire hurt Daenerys but it did to Jon Snow in season 1?

Random body shuffle every night—can we still function?

Are there any irrational/transcendental numbers for which the distribution of decimal digits is not uniform?



Restricting the Object Type for the get method in java HashMap



Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern)
Data science time! April 2019 and salary with experience
The Ask Question Wizard is Live!Does a finally block always get executed in Java?Fastest way to determine if an integer's square root is an integerA Java collection of value pairs? (tuples?)How to get an enum value from a string value in Java?Java Hashmap: How to get key from value?get string value from HashMap depending on key nameHow to update a value, given a key in a java hashmap?java.lang.OutOfMemoryError: GC overhead limit exceededConvert object array to hash map, indexed by an attribute value of the ObjectRestrict HashMap to accept a particular string key



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








9















I have instantiated my HashMap like this:



Map<String, Integer> myHashMap = new HashMap<String, Integer>();


The datatype of the Key is String, so when I try to insert a new key-value pair in the map keeping the Key as Integer, it throws an error.



myHashMap.put(1L, "value");


That means in the put method they have restricted the datatype of the Key. But while fetching the value from the map using the get method it is not checking for the datatype of the Key. So if I write something like this, it doesn't give a compilation error.



myHashMap.get(1L);


I checked the get method in the Java Map interface and its parameter type is Object, so thats why it is allowing any Object as the put method argument.



V get(Object key)


My question is, is there any way I can restrict the datatype which I pass as an argument in the get method? The argument that I pass should have the same datatype as the datatype of the Key which I use while instantiating my hashmap.










share|improve this question



















  • 1





    No. But good IDEs will warn you when doing that. And you can encapsulate the map into your own class.

    – JB Nizet
    2 hours ago











  • In other languages you could create extension method, like getTyped.... In Java you can do this with static method, so your call will be getTyped(map, key). Ugly, but works.

    – dyukha
    2 hours ago












  • I have considered the option of creating a wrapper method over the get method, something like this: Integer getMapValue(Map map, String Key) return map.get(key) And call this method instead of the get method, but I wanted to know if Java provides any such restricting feature of not?

    – Rito
    1 hour ago











  • You can add an implementation of a get(K key) method, but It seems like an unnecessary effort. The return value for a mismatching key (type-wise) will be null, as expected. So the Map will conform to its API.

    – Rann Lifshitz
    1 hour ago

















9















I have instantiated my HashMap like this:



Map<String, Integer> myHashMap = new HashMap<String, Integer>();


The datatype of the Key is String, so when I try to insert a new key-value pair in the map keeping the Key as Integer, it throws an error.



myHashMap.put(1L, "value");


That means in the put method they have restricted the datatype of the Key. But while fetching the value from the map using the get method it is not checking for the datatype of the Key. So if I write something like this, it doesn't give a compilation error.



myHashMap.get(1L);


I checked the get method in the Java Map interface and its parameter type is Object, so thats why it is allowing any Object as the put method argument.



V get(Object key)


My question is, is there any way I can restrict the datatype which I pass as an argument in the get method? The argument that I pass should have the same datatype as the datatype of the Key which I use while instantiating my hashmap.










share|improve this question



















  • 1





    No. But good IDEs will warn you when doing that. And you can encapsulate the map into your own class.

    – JB Nizet
    2 hours ago











  • In other languages you could create extension method, like getTyped.... In Java you can do this with static method, so your call will be getTyped(map, key). Ugly, but works.

    – dyukha
    2 hours ago












  • I have considered the option of creating a wrapper method over the get method, something like this: Integer getMapValue(Map map, String Key) return map.get(key) And call this method instead of the get method, but I wanted to know if Java provides any such restricting feature of not?

    – Rito
    1 hour ago











  • You can add an implementation of a get(K key) method, but It seems like an unnecessary effort. The return value for a mismatching key (type-wise) will be null, as expected. So the Map will conform to its API.

    – Rann Lifshitz
    1 hour ago













9












9








9


2






I have instantiated my HashMap like this:



Map<String, Integer> myHashMap = new HashMap<String, Integer>();


The datatype of the Key is String, so when I try to insert a new key-value pair in the map keeping the Key as Integer, it throws an error.



myHashMap.put(1L, "value");


That means in the put method they have restricted the datatype of the Key. But while fetching the value from the map using the get method it is not checking for the datatype of the Key. So if I write something like this, it doesn't give a compilation error.



myHashMap.get(1L);


I checked the get method in the Java Map interface and its parameter type is Object, so thats why it is allowing any Object as the put method argument.



V get(Object key)


My question is, is there any way I can restrict the datatype which I pass as an argument in the get method? The argument that I pass should have the same datatype as the datatype of the Key which I use while instantiating my hashmap.










share|improve this question
















I have instantiated my HashMap like this:



Map<String, Integer> myHashMap = new HashMap<String, Integer>();


The datatype of the Key is String, so when I try to insert a new key-value pair in the map keeping the Key as Integer, it throws an error.



myHashMap.put(1L, "value");


That means in the put method they have restricted the datatype of the Key. But while fetching the value from the map using the get method it is not checking for the datatype of the Key. So if I write something like this, it doesn't give a compilation error.



myHashMap.get(1L);


I checked the get method in the Java Map interface and its parameter type is Object, so thats why it is allowing any Object as the put method argument.



V get(Object key)


My question is, is there any way I can restrict the datatype which I pass as an argument in the get method? The argument that I pass should have the same datatype as the datatype of the Key which I use while instantiating my hashmap.







java hashmap






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 2 hours ago









Rann Lifshitz

3,17541435




3,17541435










asked 2 hours ago









RitoRito

1,091718




1,091718







  • 1





    No. But good IDEs will warn you when doing that. And you can encapsulate the map into your own class.

    – JB Nizet
    2 hours ago











  • In other languages you could create extension method, like getTyped.... In Java you can do this with static method, so your call will be getTyped(map, key). Ugly, but works.

    – dyukha
    2 hours ago












  • I have considered the option of creating a wrapper method over the get method, something like this: Integer getMapValue(Map map, String Key) return map.get(key) And call this method instead of the get method, but I wanted to know if Java provides any such restricting feature of not?

    – Rito
    1 hour ago











  • You can add an implementation of a get(K key) method, but It seems like an unnecessary effort. The return value for a mismatching key (type-wise) will be null, as expected. So the Map will conform to its API.

    – Rann Lifshitz
    1 hour ago












  • 1





    No. But good IDEs will warn you when doing that. And you can encapsulate the map into your own class.

    – JB Nizet
    2 hours ago











  • In other languages you could create extension method, like getTyped.... In Java you can do this with static method, so your call will be getTyped(map, key). Ugly, but works.

    – dyukha
    2 hours ago












  • I have considered the option of creating a wrapper method over the get method, something like this: Integer getMapValue(Map map, String Key) return map.get(key) And call this method instead of the get method, but I wanted to know if Java provides any such restricting feature of not?

    – Rito
    1 hour ago











  • You can add an implementation of a get(K key) method, but It seems like an unnecessary effort. The return value for a mismatching key (type-wise) will be null, as expected. So the Map will conform to its API.

    – Rann Lifshitz
    1 hour ago







1




1





No. But good IDEs will warn you when doing that. And you can encapsulate the map into your own class.

– JB Nizet
2 hours ago





No. But good IDEs will warn you when doing that. And you can encapsulate the map into your own class.

– JB Nizet
2 hours ago













In other languages you could create extension method, like getTyped.... In Java you can do this with static method, so your call will be getTyped(map, key). Ugly, but works.

– dyukha
2 hours ago






In other languages you could create extension method, like getTyped.... In Java you can do this with static method, so your call will be getTyped(map, key). Ugly, but works.

– dyukha
2 hours ago














I have considered the option of creating a wrapper method over the get method, something like this: Integer getMapValue(Map map, String Key) return map.get(key) And call this method instead of the get method, but I wanted to know if Java provides any such restricting feature of not?

– Rito
1 hour ago





I have considered the option of creating a wrapper method over the get method, something like this: Integer getMapValue(Map map, String Key) return map.get(key) And call this method instead of the get method, but I wanted to know if Java provides any such restricting feature of not?

– Rito
1 hour ago













You can add an implementation of a get(K key) method, but It seems like an unnecessary effort. The return value for a mismatching key (type-wise) will be null, as expected. So the Map will conform to its API.

– Rann Lifshitz
1 hour ago





You can add an implementation of a get(K key) method, but It seems like an unnecessary effort. The return value for a mismatching key (type-wise) will be null, as expected. So the Map will conform to its API.

– Rann Lifshitz
1 hour ago












2 Answers
2






active

oldest

votes


















9














It is designed that way, since during the get operation only the equals and hashCode is used to determine the object to be returned. The implementation of the get method does not check for the type of the Object used as the key.



In your example you are trying to get the value by passing a long like myHashMap.get(1L);, firstly the hash code of the object Long having the value 1L will be used to determine the bucket from which to look for. Next the equals method of the key is used to find out the exact entry of the map from which to return the value. And in a well-defined equals method there is always a check for the type:



public boolean equals(Object obj) 
if (obj instanceof Long) //here type is checked
return value == ((Long)obj).longValue();

return false;



So if the types are not equal, the equals method returns false and hence get also will return null.



In some cases such as when using List as a key, it may happen that you put an item in the map using an instance of say an ArrayList but you can successfully retrieve the same value with an instance of an LinkedList. As both implement the List interface.



Map<List<String>, String> myHashMap = new HashMap<>();
List<String> arrayList = new ArrayList<>();
List<String> linkedList = new LinkedList<>();
myHashMap.put(arrayList, "foo");
System.out.println(myHashMap.get(linkedList));


The above code will output in the console foo.



Here although the implementations are different but if you examine the equals method of ArrayList, it is only checking if the type is a List:



public boolean equals(Object o) 
if (o == this)
return true;


if (!(o instanceof List)) //checking type of super interface
return false;

...



The same is true for LinkedList.






share|improve this answer




















  • 1





    Kudos. That's the type of answer I expect for such an (IMHO) interesting question.

    – Rann Lifshitz
    1 hour ago











  • @RannLifshitz Thank you!

    – Amardeep Bhowmick
    1 hour ago






  • 1





    This is a good example of how an answer should be written in StackOverflow - well formulated, informative, with to-the-point code examples. Well done!

    – Rann Lifshitz
    1 hour ago


















0














I think if it is very important in a project that we control type in HashMap, we could extends HashMap and force using this class instead of HashMap like below code.
we have all HashMap capabilities, just we should use getValue method instead of get method.



import java.util.HashMap;



 public class MyHashMap<K,V> extends HashMap<K,V> 

public V getValue(K key)
return super.get(key);




test class :



 public class Test 
public static void main(String[] args)
MyHashMap<String,Integer> map = new MyHashMap();







share|improve this answer


















  • 1





    A similar answer was posted maybe an hour ago and was then deleted by its poster...........

    – Rann Lifshitz
    1 hour ago











Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55790456%2frestricting-the-object-type-for-the-get-method-in-java-hashmap%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























2 Answers
2






active

oldest

votes








2 Answers
2






active

oldest

votes









active

oldest

votes






active

oldest

votes









9














It is designed that way, since during the get operation only the equals and hashCode is used to determine the object to be returned. The implementation of the get method does not check for the type of the Object used as the key.



In your example you are trying to get the value by passing a long like myHashMap.get(1L);, firstly the hash code of the object Long having the value 1L will be used to determine the bucket from which to look for. Next the equals method of the key is used to find out the exact entry of the map from which to return the value. And in a well-defined equals method there is always a check for the type:



public boolean equals(Object obj) 
if (obj instanceof Long) //here type is checked
return value == ((Long)obj).longValue();

return false;



So if the types are not equal, the equals method returns false and hence get also will return null.



In some cases such as when using List as a key, it may happen that you put an item in the map using an instance of say an ArrayList but you can successfully retrieve the same value with an instance of an LinkedList. As both implement the List interface.



Map<List<String>, String> myHashMap = new HashMap<>();
List<String> arrayList = new ArrayList<>();
List<String> linkedList = new LinkedList<>();
myHashMap.put(arrayList, "foo");
System.out.println(myHashMap.get(linkedList));


The above code will output in the console foo.



Here although the implementations are different but if you examine the equals method of ArrayList, it is only checking if the type is a List:



public boolean equals(Object o) 
if (o == this)
return true;


if (!(o instanceof List)) //checking type of super interface
return false;

...



The same is true for LinkedList.






share|improve this answer




















  • 1





    Kudos. That's the type of answer I expect for such an (IMHO) interesting question.

    – Rann Lifshitz
    1 hour ago











  • @RannLifshitz Thank you!

    – Amardeep Bhowmick
    1 hour ago






  • 1





    This is a good example of how an answer should be written in StackOverflow - well formulated, informative, with to-the-point code examples. Well done!

    – Rann Lifshitz
    1 hour ago















9














It is designed that way, since during the get operation only the equals and hashCode is used to determine the object to be returned. The implementation of the get method does not check for the type of the Object used as the key.



In your example you are trying to get the value by passing a long like myHashMap.get(1L);, firstly the hash code of the object Long having the value 1L will be used to determine the bucket from which to look for. Next the equals method of the key is used to find out the exact entry of the map from which to return the value. And in a well-defined equals method there is always a check for the type:



public boolean equals(Object obj) 
if (obj instanceof Long) //here type is checked
return value == ((Long)obj).longValue();

return false;



So if the types are not equal, the equals method returns false and hence get also will return null.



In some cases such as when using List as a key, it may happen that you put an item in the map using an instance of say an ArrayList but you can successfully retrieve the same value with an instance of an LinkedList. As both implement the List interface.



Map<List<String>, String> myHashMap = new HashMap<>();
List<String> arrayList = new ArrayList<>();
List<String> linkedList = new LinkedList<>();
myHashMap.put(arrayList, "foo");
System.out.println(myHashMap.get(linkedList));


The above code will output in the console foo.



Here although the implementations are different but if you examine the equals method of ArrayList, it is only checking if the type is a List:



public boolean equals(Object o) 
if (o == this)
return true;


if (!(o instanceof List)) //checking type of super interface
return false;

...



The same is true for LinkedList.






share|improve this answer




















  • 1





    Kudos. That's the type of answer I expect for such an (IMHO) interesting question.

    – Rann Lifshitz
    1 hour ago











  • @RannLifshitz Thank you!

    – Amardeep Bhowmick
    1 hour ago






  • 1





    This is a good example of how an answer should be written in StackOverflow - well formulated, informative, with to-the-point code examples. Well done!

    – Rann Lifshitz
    1 hour ago













9












9








9







It is designed that way, since during the get operation only the equals and hashCode is used to determine the object to be returned. The implementation of the get method does not check for the type of the Object used as the key.



In your example you are trying to get the value by passing a long like myHashMap.get(1L);, firstly the hash code of the object Long having the value 1L will be used to determine the bucket from which to look for. Next the equals method of the key is used to find out the exact entry of the map from which to return the value. And in a well-defined equals method there is always a check for the type:



public boolean equals(Object obj) 
if (obj instanceof Long) //here type is checked
return value == ((Long)obj).longValue();

return false;



So if the types are not equal, the equals method returns false and hence get also will return null.



In some cases such as when using List as a key, it may happen that you put an item in the map using an instance of say an ArrayList but you can successfully retrieve the same value with an instance of an LinkedList. As both implement the List interface.



Map<List<String>, String> myHashMap = new HashMap<>();
List<String> arrayList = new ArrayList<>();
List<String> linkedList = new LinkedList<>();
myHashMap.put(arrayList, "foo");
System.out.println(myHashMap.get(linkedList));


The above code will output in the console foo.



Here although the implementations are different but if you examine the equals method of ArrayList, it is only checking if the type is a List:



public boolean equals(Object o) 
if (o == this)
return true;


if (!(o instanceof List)) //checking type of super interface
return false;

...



The same is true for LinkedList.






share|improve this answer















It is designed that way, since during the get operation only the equals and hashCode is used to determine the object to be returned. The implementation of the get method does not check for the type of the Object used as the key.



In your example you are trying to get the value by passing a long like myHashMap.get(1L);, firstly the hash code of the object Long having the value 1L will be used to determine the bucket from which to look for. Next the equals method of the key is used to find out the exact entry of the map from which to return the value. And in a well-defined equals method there is always a check for the type:



public boolean equals(Object obj) 
if (obj instanceof Long) //here type is checked
return value == ((Long)obj).longValue();

return false;



So if the types are not equal, the equals method returns false and hence get also will return null.



In some cases such as when using List as a key, it may happen that you put an item in the map using an instance of say an ArrayList but you can successfully retrieve the same value with an instance of an LinkedList. As both implement the List interface.



Map<List<String>, String> myHashMap = new HashMap<>();
List<String> arrayList = new ArrayList<>();
List<String> linkedList = new LinkedList<>();
myHashMap.put(arrayList, "foo");
System.out.println(myHashMap.get(linkedList));


The above code will output in the console foo.



Here although the implementations are different but if you examine the equals method of ArrayList, it is only checking if the type is a List:



public boolean equals(Object o) 
if (o == this)
return true;


if (!(o instanceof List)) //checking type of super interface
return false;

...



The same is true for LinkedList.







share|improve this answer














share|improve this answer



share|improve this answer








edited 1 hour ago

























answered 1 hour ago









Amardeep BhowmickAmardeep Bhowmick

6,31121230




6,31121230







  • 1





    Kudos. That's the type of answer I expect for such an (IMHO) interesting question.

    – Rann Lifshitz
    1 hour ago











  • @RannLifshitz Thank you!

    – Amardeep Bhowmick
    1 hour ago






  • 1





    This is a good example of how an answer should be written in StackOverflow - well formulated, informative, with to-the-point code examples. Well done!

    – Rann Lifshitz
    1 hour ago












  • 1





    Kudos. That's the type of answer I expect for such an (IMHO) interesting question.

    – Rann Lifshitz
    1 hour ago











  • @RannLifshitz Thank you!

    – Amardeep Bhowmick
    1 hour ago






  • 1





    This is a good example of how an answer should be written in StackOverflow - well formulated, informative, with to-the-point code examples. Well done!

    – Rann Lifshitz
    1 hour ago







1




1





Kudos. That's the type of answer I expect for such an (IMHO) interesting question.

– Rann Lifshitz
1 hour ago





Kudos. That's the type of answer I expect for such an (IMHO) interesting question.

– Rann Lifshitz
1 hour ago













@RannLifshitz Thank you!

– Amardeep Bhowmick
1 hour ago





@RannLifshitz Thank you!

– Amardeep Bhowmick
1 hour ago




1




1





This is a good example of how an answer should be written in StackOverflow - well formulated, informative, with to-the-point code examples. Well done!

– Rann Lifshitz
1 hour ago





This is a good example of how an answer should be written in StackOverflow - well formulated, informative, with to-the-point code examples. Well done!

– Rann Lifshitz
1 hour ago













0














I think if it is very important in a project that we control type in HashMap, we could extends HashMap and force using this class instead of HashMap like below code.
we have all HashMap capabilities, just we should use getValue method instead of get method.



import java.util.HashMap;



 public class MyHashMap<K,V> extends HashMap<K,V> 

public V getValue(K key)
return super.get(key);




test class :



 public class Test 
public static void main(String[] args)
MyHashMap<String,Integer> map = new MyHashMap();







share|improve this answer


















  • 1





    A similar answer was posted maybe an hour ago and was then deleted by its poster...........

    – Rann Lifshitz
    1 hour ago















0














I think if it is very important in a project that we control type in HashMap, we could extends HashMap and force using this class instead of HashMap like below code.
we have all HashMap capabilities, just we should use getValue method instead of get method.



import java.util.HashMap;



 public class MyHashMap<K,V> extends HashMap<K,V> 

public V getValue(K key)
return super.get(key);




test class :



 public class Test 
public static void main(String[] args)
MyHashMap<String,Integer> map = new MyHashMap();







share|improve this answer


















  • 1





    A similar answer was posted maybe an hour ago and was then deleted by its poster...........

    – Rann Lifshitz
    1 hour ago













0












0








0







I think if it is very important in a project that we control type in HashMap, we could extends HashMap and force using this class instead of HashMap like below code.
we have all HashMap capabilities, just we should use getValue method instead of get method.



import java.util.HashMap;



 public class MyHashMap<K,V> extends HashMap<K,V> 

public V getValue(K key)
return super.get(key);




test class :



 public class Test 
public static void main(String[] args)
MyHashMap<String,Integer> map = new MyHashMap();







share|improve this answer













I think if it is very important in a project that we control type in HashMap, we could extends HashMap and force using this class instead of HashMap like below code.
we have all HashMap capabilities, just we should use getValue method instead of get method.



import java.util.HashMap;



 public class MyHashMap<K,V> extends HashMap<K,V> 

public V getValue(K key)
return super.get(key);




test class :



 public class Test 
public static void main(String[] args)
MyHashMap<String,Integer> map = new MyHashMap();








share|improve this answer












share|improve this answer



share|improve this answer










answered 1 hour ago









hamid rostamihamid rostami

467




467







  • 1





    A similar answer was posted maybe an hour ago and was then deleted by its poster...........

    – Rann Lifshitz
    1 hour ago












  • 1





    A similar answer was posted maybe an hour ago and was then deleted by its poster...........

    – Rann Lifshitz
    1 hour ago







1




1





A similar answer was posted maybe an hour ago and was then deleted by its poster...........

– Rann Lifshitz
1 hour ago





A similar answer was posted maybe an hour ago and was then deleted by its poster...........

– Rann Lifshitz
1 hour ago

















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55790456%2frestricting-the-object-type-for-the-get-method-in-java-hashmap%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Isabella Eugénie Boyer Biographie | Références | Menu de navigationmodifiermodifier le codeComparator to Compute the Relative Value of a U.S. Dollar Amount – 1774 to Present.

Join wedge with single bond in chemfigHow to make only one part of double bond bold with chemfig?Crossing bonds in chemfigjoining atoms in chemfig. Two adjacent molculesHow do I selectively change bond length in chemfig?Ugly bond joints in chemfigchemfig: reaction above arrowUsing the mhchem and chemfig packages in conjunctionBonding to specific element letter using chemfigResonance hybrids in chemfigScale chemfig molecule in beamer with tikzWhy does this chemfig bond with a hook start in the middle of the atom?

Compiling documents onlineAre any web base TEX editors with live collaboration available?Is there a web-based LaTeX or TeX editor?Creating a PDF file online from a LaTeX templateAre there any online LaTeX editors that provide the latest packages?Comparison of browser-based latex processorsCan I find something like this online?Is there a site where I can enter a latex expression, and it shows me an image of the compiled expression?Automatic online compiling systemA resource for converting LaTeX within the browserIs there an equivalent of jsfiddle for LaTeX?Online LaTeX syntax highlighterComparison of browser-based latex processorsDo the online LaTeX compilers use a TeX daemon to speed up their compilation?Undefined control sequence documentclassLaTeX Syntax Highlighting in Google DriveWhy are my Latex compile times varying massively?Online compilation with commercial fontsCompiling multiple LaTeX filesSlow compiling of large documents in TeXstudiodocument not compiling with custom .cls