81,122
社区成员




public Object get(List list1,List list2){
Random r = new Random();
if(r.nextInt(10)<1){
return list1==null || list1.size()==0 ? null : list1.get(r.nextInt(list1.size()));
}else{
return list2==null || list2.size()==0 ? null : list2.get(r.nextInt(list2.size()));
}
}
public Object get(List list1,List list2){
Random r = new Random();
if(r.nextInt(10)<1){
return list1==null && list1.size()==0 ? null : list1.get(r.nextInt(list1.size()));
}else{
return list2==null && list2.size()==0 ? null : list2.get(r.nextInt(list2.size()));
}
}
概率只能说是很多次点击之后统计的规律,而不是说点10次就肯定一次去A里面取,9次去B里面去。
你对概率的说法有问题。