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 -

reflection - How to access the object-members of an object declaration in kotlin -

php - Doctrine Query Builder Error on Join: [Syntax Error] line 0, col 87: Error: Expected Literal, got 'JOIN' -