java中随机选取一个数 public int getNum(){ int n=0; int a[]={28,34,56,25,7,90,3}; java.util.Random r=new java.util.Random(); n=r.nextInt(a.length); n=a[n]; return n; }