Quantcast
Channel: Collections.reverse method not reversing entry - Stack Overflow
Viewing all articles
Browse latest Browse all 6

Answer by Tunaki for Collections.reverse method not reversing entry

$
0
0

You misinterpreted what Collections.reverse does. This method reverses the list that you gave, not its content. Since you called this method with a list having a single element, the result will be the same list.

If you want to reverse a String, please refer to this question.

As a side-note: do not use raw types like ArrayList, this will get into trouble. Prefer the type-safe way ArrayList<String>.


Viewing all articles
Browse latest Browse all 6

Trending Articles