开发者

Javadocs and jdk mismatch on NavigableSet/Map?

开发者 https://www.devze.com 2023-01-15 08:31 出处:网络
The NavigableSet API docs state that methods headSet,tailSet(E),headSet(E) and subSet(E, E) return a NavigableSet.

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?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消