I'm trying to get the last added item in an ArrayList to compare it to the next item I'm about to add to it. If they are equal, continue. Like:
if (stringArray.get(stringArray.IndexOfLastItemAdded()) == compareLastItemToThis) {
continue;
}
else {
stringArray.add(compareLastItemToThis);
}
I know IndexOfLastItemAdded
doesn't exist, but is there something similar to it?