Robert

19%
Flag icon
If a class has multiple significant fields, the order in which you compare them is critical.
Robert
If your class has multiple significant fields, that's a good flag to consider whether the object has natural ordering. For example, even just people's names: sort by first name then last name, or the other way around? Instead, consider forgoing implying that there's a natural ordering (and provide Comparators).
Effective Java
Rate this book
Clear rating
Open Preview