java - I need to hold multiple int values in a Map -


i need create book index method can pair multiple values 1 key

e.g key - "beck,kent" value - 27 23 76

is possible?

the import ou.*; open university library , should not affect anything.

import java.util.*; import ou.*; public class bookindex {  public map<string, integer> index() {    map<string, integer> actual = new hashmap<>();    return actual; } 

thanks

how using integer array instead of integer in map<string, integer>.

 hashmap<string, integer[]> anewmap = new hashmap<string, integer[]>();   anewmap.put("beck,kent",new integer[] { 27, 23, 76}); 

Comments

Popular posts from this blog

c++ - Function signature as a function template parameter -

algorithm - What are some ways to combine a number of (potentially incompatible) sorted sub-sets of a total set into a (partial) ordering of the total set? -

How to call a javascript function after the page loads with a chrome extension? -