how to make a set of array in java?

前端 未结 5 1562
醉梦人生
醉梦人生 2020-12-22 11:29

Since the equals function in array only check the instance, it doesn\'t work well with Set. Hence, I wonder how to make a set of arrays in java?

One possible way cou

5条回答
  •  春和景丽
    2020-12-22 12:30

    If you make your Set be an instance of TreeSet, you can specify a custom Comparator which will be used for all comparisons (even equality).

提交回复
热议问题