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?

How to resize main filesystem

Why are current probes so expensive?

Vertical ranges of Column Plots in 12

What does Sonny Burch mean by, "S.H.I.E.L.D. and HYDRA don't even exist anymore"?

By what mechanism was the 2017 UK General Election called?

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

Did pre-Columbian Americans know the spherical shape of the Earth?

How does Billy Russo acquire his 'Jigsaw' mask?

Is there a canonical “inverse” of Abelianization?

Did John Wesley plagiarize Matthew Henry...?

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

Proving that any solution to the differential equation of an oscillator can be written as a sum of sinusoids.

Searching extreme points of polyhedron

Any stored/leased 737s that could substitute for grounded MAXs?

Keep at all times, the minus sign above aligned with minus sign below

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

Improvising over quartal voicings

An isoperimetric-type inequality inside a cube

How to ask rejected full-time candidates to apply to teach individual courses?

malloc in main() or malloc in another function: allocating memory for a struct and its members

How do Java 8 default methods hеlp with lambdas?

As a dual citizen, my US passport will expire one day after traveling to the US. Will this work?

Table formatting with tabularx?



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;








8















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
    1 hour 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
    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

















8















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
    1 hour 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
    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













8












8








8


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 1 hour ago









Rann Lifshitz

3,17541435




3,17541435










asked 1 hour ago









RitoRito

1,086718




1,086718







  • 1





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

    – JB Nizet
    1 hour 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
    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












  • 1





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

    – JB Nizet
    1 hour 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
    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







1




1





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

– JB Nizet
1 hour ago





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

– JB Nizet
1 hour 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
1 hour 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
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





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


















8














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
    57 mins 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









8














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
    57 mins ago















8














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
    57 mins ago













8












8








8







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,30121230




6,30121230







  • 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
    57 mins 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
    57 mins 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
57 mins 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
57 mins 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

名間水力發電廠 目录 沿革 設施 鄰近設施 註釋 外部連結 导航菜单23°50′10″N 120°42′41″E / 23.83611°N 120.71139°E / 23.83611; 120.7113923°50′10″N 120°42′41″E / 23.83611°N 120.71139°E / 23.83611; 120.71139計畫概要原始内容臺灣第一座BOT 模式開發的水力發電廠-名間水力電廠名間水力發電廠 水利署首件BOT案原始内容《小檔案》名間電廠 首座BOT水力發電廠原始内容名間電廠BOT - 經濟部水利署中區水資源局

Prove that NP is closed under karp reduction?Space(n) not closed under Karp reductions - what about NTime(n)?Class P is closed under rotation?Prove or disprove that $NL$ is closed under polynomial many-one reductions$mathbfNC_2$ is closed under log-space reductionOn Karp reductionwhen can I know if a class (complexity) is closed under reduction (cook/karp)Check if class $PSPACE$ is closed under polyonomially space reductionIs NPSPACE also closed under polynomial-time reduction and under log-space reduction?Prove PSPACE is closed under complement?Prove PSPACE is closed under union?

Is my guitar’s action too high? Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern)Strings too stiff on a recently purchased acoustic guitar | Cort AD880CEIs the action of my guitar really high?Μy little finger is too weak to play guitarWith guitar, how long should I give my fingers to strengthen / callous?When playing a fret the guitar sounds mutedPlaying (Barre) chords up the guitar neckI think my guitar strings are wound too tight and I can't play barre chordsF barre chord on an SG guitarHow to find to the right strings of a barre chord by feel?High action on higher fret on my steel acoustic guitar