Quantcast
Channel: Sorting a List - How to? - Stack Overflow
Browsing latest articles
Browse All 3 View Live

Answer by Ibrokhim Kholmatov for Sorting a List - How to?

You could implement your method in the following way:private Set<Size> getSortedSizes(List<Size> allSizes) { Set<Size> sorted = new TreeSet<>(sortedArray); return sorted;}But...

View Article



Answer by OneCricketeer for Sorting a List - How to?

Add to a TreeSet, not an ArraylistTreeSets are ordered and cannot contain duplicates

View Article

Sorting a List - How to?

I have three object classes called Size1, Size2, Size3All Size classes has different values (all Values are Strings):Size1.getValue() = "1"Size2.getValue() = "2"Size3.getValue() = "1"I want to sort a...

View Article
Browsing latest articles
Browse All 3 View Live




Latest Images