import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
public class Test22选5 {
public static void main(String[] args) {
List<Integer> list=new ArrayList<Integer>();
for (int i = 1; i <=22; i++) {
list.add(i);
}
System.out.println(list);
Collections.shuffle(list);//打乱顺序
System.out.println(list.subList(0, 5));//随机输出5个数
}
}