posted 15 years ago
Thanks for the clarification!
This works on TreeSet, not on HashSet. since the subSet(), headSet(), tailSet() work only on sorted Sets.
Here's an example using TreeSet,
which gives the output,
ts :
[1245, 1500, 1550, 1600, 2000, 2010, 2100]
subset :
[1245, 1500, 1550]
1550
subs :
[2000, 2010, 2100]
2000
subs1 :
[1245, 1500, 1550, 1600]
1600