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

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

Qt QGraphicsScene is not accessable from QGraphicsView (on Qt 5.6.1) -

What is happening when Matlab is starting a "parallel pool"? -