Should a custom Java HashMap size be used? -


I am working on a Minecraft PvP mod and a Hashup to store every player's name with my team I want to use. They will have a total of 64 players in a match and at one time there will be only 1 match on the server.

Do I have to use Hashp that is 64 slots? I had a very bad time in the past that I understand how it works, I am starting it right now.

itemprop = "text">

No, if the hashmap default to 0.75, keep your load factor automatically The size will increase if you do not specify anything even if you do not explicitly do anything about it, then when you do not use all 64 entries then your hashmap < / Code> will increase as much as you organize it.

Because you want to specify in the initial capacity, in fact only if you already know that you are going to fill it with at least a few entries, so that it will be re- Sharing and re-assigning will have to be above.

In short: If you leave only Hashmap leaving your code, then this is usually OK. :)

Comments

Popular posts from this blog

c - Mpirun hangs when mpi send and recieve is put in a loop -

python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

java - Unable to get JDBC connection in Spring application to MySQL -