문제

Can TreeSet be sorted in opposite way when objects are already in the set?

I mean, I inserted 10^6 words in a TreeSet and I want to sort it now the opposite way. To my knowledge this is not possible, but I need to ask.

도움이 되었습니까?

해결책

You can use TreeSet.descendingSet() to return a reverse view of it. You should always read the javadocs (and then Google) before asking a question here or anywhere else.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top