In Java, what interface(class) should a class implement(extend) in order to allow two instances of the class to be comparable through relational operators like "<" or ">="?
This is not possible in Java.
If you want objects of your class to be comparable, implement Comparable
.
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