??????????????????飺
????ArrayList<Integer> mArrayList = new ArrayList<Integer>();
????mArrayList.add(0);
????mArrayList.add(1);
????mArrayList.add(2);
????mArrayList.add(3);
???????????????????2????  ????????????????????????
????public void getValue(ArrayList<Integer> mArrayList){
????Random mRandom = new Random();
????int a = mRandom.nextInt(mArrayList.size());
????int value = mArrayList.get(a);
????System.out.println(value + "");
????mArrayList.remove(a);
????}
???????????????????????????????????????????????????????
????????????
package com.xiaoqiu.test;
import java.util.ArrayList;
import java.util.Random;
public class Test {
public static void main(String[] args) {
ArrayList<Integer> mArrayList = new ArrayList<Integer>();
mArrayList.add(0);
mArrayList.add(1);
mArrayList.add(2);
mArrayList.add(3);
Test mTest = new Test();
mTest.getValue(mArrayList);
mTest.getValue(mArrayList);
}
public void getValue(ArrayList<Integer> mArrayList){
Random mRandom = new Random();
int a = mRandom.nextInt(mArrayList.size());
int value = mArrayList.get(a);
System.out.println(value + "");
mArrayList.remove(a);
}
}
????????????
????3
????2
????3
????0
????2
????3