📜  随机打乱java代码示例

📅  最后修改于: 2022-03-11 14:52:40.863000             🧑  作者: Mango

代码示例2
for (int i = myList.length - 1; i > 0; i--){
            int j = (int) (Math.random() * (i + 1));

            double temp = myList[i];
            myList[i] = myList[j];
            myList[j] = temp;
        }