pablisco
01/30/2020, 10:56 PMList
using Arrays.asList(...)
coming from Java and when I compare it with a list created with listOf()
in Kotlin:
https://pl.kotl.in/cQxTchtL0
Why aren’t following the equals
contract? Anyone experienced this before? 🤔diesieben07
01/30/2020, 11:00 PMjava.util.Arrays.asList(array)
creates List<Array<String>>
here. This list has one element in it, your array.
asList
is a varags function, such a function cannot directly be called with an array in Kotlin, you'd have to use the spread operator:
java.util.Arrays.asList(*array)
.
However you should just use array.asList()
.pablisco
01/30/2020, 11:05 PMpablisco
01/30/2020, 11:06 PMpablisco
01/30/2020, 11:13 PMtest()
bit… it says the size is not correctdiesieben07
01/30/2020, 11:13 PMpablisco
01/30/2020, 11:13 PMpablisco
01/30/2020, 11:14 PMdiesieben07
01/30/2020, 11:15 PMvalues
at least is an ArrayList
so it could...pablisco
01/30/2020, 11:16 PMpablisco
01/30/2020, 11:17 PM