I have an ArrayList where I add Strings like [string1 string2 string3 code]. This code is just a number I give to each string. But this code is what I have to use to delete or use a string.
So lets suppose I have a arrayList with the next strings:
String_1 = string1 string2 string3 1
String_2 = string4 string5 string6 2
String_3 = string7 string8 string9 3
Now, if I want to delete String_2 I have to do: delete string "code" in this case, delete string 2. this would delete the String_2 from the arrayList.
Also, if I want to extract String_1 from the arraylist and set it in a String, I have to do it using the code.
So, what will be the way to do this in java? Maybe is something easy for many of you, but I'm new with this and arrayList is still something a bit dificult for me.