java - Filling Hashmap without using put too much -
for context: need fill hashmap values corresponding input user gives. 1-20 in height , t in length. user can specifiy these input.
my question is, how go around filling hashmap values without repeating below 400 times?
hashmap.put(k key, v value)
the hashmap looks hashmap<string, square>
square being a(empty now) class.
why not use loop e.g.
for(int i=1; i<=400; i++){ //code insert key , value //insert hashmap hashmap.put(k key, v value); }
Comments
Post a Comment