5

Are there any other alternatives to achieve the same in Java ? In C++, I can use these wonderful methods and make my life easier. Is it possible in Java too ? My sole aim is to write code which is simple and clean and which is not error prone.

sumanth232
  • 587
  • 7
  • 20

1 Answers1

2

Java class TreeSet which is based on search tree of comparable objects instead of hash table has similar methods floor and ceiling. More generic methods for any iterable type you are free to implement by yourself.

Odomontois
  • 15,918
  • 2
  • 36
  • 71