kondakindi
IS-IT--Management
Hi,
I have a Hashmap of arraylist which means the values of the hashmap are arraylist of 1,2 ,3,5 etc
when i read the specfic value of the has map based on get and check it with a string it returns false even if the string is the same.
eg:
HashMap hm=new Hashmap();
Assume this has key like "job_cat" and multiple values in form of(ArrayList) like ['a,b']
Sytem.out.println(hm.get("job_cat"));
it returns - [a,b]
if i check using a string which has 'a' value
String str="a";
if (str.equals(hm.get("job_cat")))
or if (str==hm.get("job_cat"))
Both the above statment returns false.
Could you tell me how should i check if String value is equal to Hashmap .
It doesn't even work with containsValue();
Thanks ,
I have a Hashmap of arraylist which means the values of the hashmap are arraylist of 1,2 ,3,5 etc
when i read the specfic value of the has map based on get and check it with a string it returns false even if the string is the same.
eg:
HashMap hm=new Hashmap();
Assume this has key like "job_cat" and multiple values in form of(ArrayList) like ['a,b']
Sytem.out.println(hm.get("job_cat"));
it returns - [a,b]
if i check using a string which has 'a' value
String str="a";
if (str.equals(hm.get("job_cat")))
or if (str==hm.get("job_cat"))
Both the above statment returns false.
Could you tell me how should i check if String value is equal to Hashmap .
It doesn't even work with containsValue();
Thanks ,