I’m new to Java and trying to learn.
Java doesn’t have operator overloading, so when coding a value object I understand that you need to compare objects with an overridden ‘equals’ method instead of the == operator, but I have yet to read about the other methods you need to override. What about the equivalent methods for the other common operators: >, <, >=, and <=. Do these methods need to be overridden, or do I have to create them if I need them. If I have to create these methods, there must be some standard naming convention for them (‘gt’, ‘lt’, ‘gte’, ‘lte’). What is it?
Look into the
Comparableinterface.