I am returning a List from my class A. I would like to remove the first item from the list and add it as the last item to the same list. I did it this way.
myList.add(myList.get(0));
myList.remove(0);
The target equipment is Android OS. Should I code my class Aso that it returns ArrayListor LinkedList? What would be better for the following scenarios:
Perhaps I see a problem when it is not there. Do you think that in this case I should not care about performance, since the size of the problem (for 1 and 2) is small?
I know that "premature optimization is the root of all evil." This is why I am embarrassed before changing my incarnation (since now my object Areturns an ArrayList).
source
share