从数组中随机选择一个数

public static void main(String[] args) {
   int []numbers = {1,2,5,4,3,46,66,36,6};
   Random random = new Random();
   int index = random.nextInt(numbers.length);
   System.out.println(numbers[index]);  
   }
 

  

原文地址:https://www.cnblogs.com/dreammyone/p/7068352.html