Return type from a Comparator

前端 未结 6 1418
暖寄归人
暖寄归人 2020-12-09 15:16

What does the return value inside the Comparator actually mean?

For example :

class TreeSetDemo
{
    public static void main(String         


        
6条回答
  •  青春惊慌失措
    2020-12-09 15:56

    Comparator documentation -- Returns: a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.

提交回复
热议问题