I want to compare every String with all the other Strings in the ArrayList, if that string matches with one of the String in ArrayList then I want to make some changes to that particular String.
Siddhesh Khedekar wrote:then I want to make some changes to that particular String.
Do you mean you want to change the String at a specific List index? Because you know you can't change Strings themselves, right? Only references to it, including being a List element.
I suggest you look at ListIterator (and List.listIterator()). With it you can iterate over the List, then call set to change the value without having to worry about a nasty ConcurrentModificationException.