Home > Back-end >  The natural order and custom order consult Java
The natural order and custom order consult Java

Time:10-10

TreeSet Comparable natural ordering and Comparator: is there any difference between the custom sorting,

With Comparable, can change to a custom sorting, the method of change, is there any difference between it and the Comparator?
Can achieve a goal, just is not the same as the implementation process, the API why points are available both natural and custom interface, natural ordering method can change the custom, the custom also can realize natural,
Just the way is a little difference of both, so why to be like this?

The difference between
A when the referee, involved with
One is when the referee, not involved with
Feel no difference between

CodePudding user response:

To understand the... ...
  • Related