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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With