Home > Back-end >  In Java HashMap ArrayList collections such as initial capacity setting?
In Java HashMap ArrayList collections such as initial capacity setting?

Time:09-22

In Java HashMap ArrayList collections such as initial capacity setting, everyone is so set? According to the different scenarios, it is necessary to specify or use the default values?

CodePudding user response:

There is a scene, for example, will pick up to 50-100 data from the database, but not sure, that so set the initial capacity?

CodePudding user response:

Why do you want to set the initial capacity, these things will be according to the amount of data increases with the expansion of automatically

CodePudding user response:

rates quoted 2 floor uncle plantain response:
why want to set the initial capacity, increased with the amount of these things will be according to the data of expanding capacity of automatic

Expansion a is time-consuming, must carry on the data migration
  • Related