191119 Collections shuffle
在 Kotlin 範例程式碼中看到以下 Code Collections.shuffle(list) 但 Android Studio 卻出現以下的 Warning Call of java mutator shuffle on immutable Kotlin collection ------------ 找到的 Kotlin 文件如下。 fun < T > MutableList < T > . shuffle ( ) ------------ 於是把上面的程式碼改為 val mutableList = list. toMutableList () mutableList. shuffle () list = mutableList. toList ()