Posts Tagged ‘TreeSet’

TreeSet For Sorting Order

Posted: 21st November 2012 by Peter in Java
Tags: , , ,

We’re covering ‘Collections’, ‘Collection’ and erm…’collection’ in Java Programmer 6 at the moment. I’m familiarizing myself with the various Sets, Lists and Maps. A TreeSet orders its elements using ‘natural ordering’, i.e. alphabetical order for Strings, numerical order for ints. This is a very useful feature of the TreeSet that I wanted to experiment with. I wrote […]