lundi 25 juillet 2016

Searching an arrayList for an object and then adding value to that same object more than once

I just started working with arrayLists - basically what I need to figure out is how to search my arrayList and if that same object is found to add a new total value to it versus just swapping it out.

ie.

arrayList = (hats, $45) 

and I have a new value to add to hats (ie. $10 dollars) - so the ultimate new total for hats = $55

...and if hats are not in the list already to add it.

Any help is appreciated !

Aucun commentaire:

Enregistrer un commentaire