Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

setting a hashmap key with a combination of Integer values

user8769643Nov 10 2009 — edited Nov 11 2009
hi ,

I am newbie to java and need some help with setting a hashmap key with a combination of integer values.

My hashmap is
private Map<String, Boolean> map = new HashMap<String, Boolean>();
Now In the map i want to set the key value something like this:
int x = 123;
         int y = 456;
        
        map.put("123-456" , true);
I know i say map.put("x-y" ,true) it will get the corresponding x and y values. Please advise how to do this.

Thank You So Much

Edited by: twisai on Nov 10, 2009 1:35 PM
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 9 2009
Added on Nov 10 2009
9 comments
619 views