Can we use integer as a key for the string in the HASHMAP?
engrjd91
0
Junior Poster in Training
Recommended Answers
Jump to PostIf you want to use an integer as a key in a Map you'll need to use a primitive wrapper.
Here's an example of that:
Map<Integer, String> map;
Note that the following is not valid:
Map<int, String> map; // invalid
All 2 Replies
Reply to this topic
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.