说我有一个Kotlin方法,我在其中做一个打印行来比较ArrayList<Char>
的两个实例:
println("doSomething() normal equals: ${charList1 == charList2}, content compare: ${charList1.toArray().contentEquals(charList2.toArray())}")
为什么打印以下内容:
"doSomething() normal equals: false, content compare: true"
而不是:
"doSomething() normal equals: true, content compare: true"
根据Kotlin docs正常值应该起作用