Why is my simple comparator broken?

前端 未结 6 1255
故里飘歌
故里飘歌 2021-01-04 01:56

I have a class, which I have simplified to this:

final class Thing {
    private final int value;
    public Thing(int value) {
        this.value = value;
          


        
6条回答
  •  一向
    一向 (楼主)
    2021-01-04 02:08

    What kind of numbers do you throw in there? If your numbers are large enough, you could wrap through the MIN/MAX values for integers and end up in a mess.

提交回复
热议问题