views:

27

answers:

1

The NavigableSet API docs state that methods headSet,tailSet(E),headSet(E) and subSet(E, E) return a NavigableSet.

In Eclipse, I get a type mismatch error, although I use the 1.6_20 jdk and have my compiler compliance set to 1.6, so I have to "downgrade" the return value to SortedSet.

Am I missing something?

+1  A: 

You may have misread the javadoc. There two headSet methods, one returns SortedSet and the other returns NavigableSet. The same for the other methods you mentioned.

Thomas Mueller