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
Post a Comment