什么是比较合同? [英] What is the compare contract?
本文介绍了什么是比较合同?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的Java代码引发了以下异常:
My java code threw the following exception:
java.lang.IllegalArgumentException: Comparison method violates its general contract!
我研究了StackOverflow上的消息,发现了几个问题,这些问题张贴了他们写得不好的比较方法,但是我想知道合同写在哪里,以及关于比较方法必须做什么的确切说明.
I researched the message on StackOverflow and found several questions that posted their poorly written compare methods, but I was wondering where the contract is written and what exactly does it state regarding what the compare method must do.
推荐答案
查看全文