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 -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -