Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to replace a specific element in a LinkedHashSet?

With an ArrayList I would do something like

myList.set(myList.indexOf(oldItemNumber), newItemNumber);

Is there an easy way to achieve this for LinkedHashSet?

like image 999
GedankenNebel Avatar asked Dec 13 '13 10:12

GedankenNebel


1 Answers

Just use the put() method. It will update that specific entry.

like image 72
Juvanis Avatar answered Sep 19 '22 13:09

Juvanis