Solved Need help with HashMaps

Discussion in 'Plugin Development' started by TheGameszocker, Feb 10, 2015.

Thread Status:
Not open for further replies.
  1. Offline

    TheGameszocker

    I have created a HashMap and I want to increment every single value.How can I do that?
     
  2. Offline

    Funergy

    @TheGameszocker Loop through the hashmap with Entry set then you should get
    <the entry set>.value or <the entry set>.key here you just put these values in a new hashmap and do <the entry set>.value -1; and after the loop set the new hashmap to the normal hashmap. So this will keep the exception CurrentModificationException away
     
  3. Offline

    ProMCKingz

    @TheGameszocker
    You could also make a for loop, something like this for(Player p : hashmap.keyset()){
     
  4. Offline

    TheGameszocker

Thread Status:
Not open for further replies.

Share This Page