public static void main(String[] args) {
Map<Integer, Map<Integer, Integer>> lotteryTicketMap = new HashMap<Integer, Map<Integer,Integer>>();
Random r = new Random();
for(int i = 0 ; i < 5;i++){
Map<Integer, Integer> map = new HashMap<Integer, Integer>();
for(int j = 0 ; j < 7 ; ){
int num = r.nextInt(35)+1;
if(map.get(j)==null){
map.put(j, num);
j++;
}
}
lotteryTicketMap.put(i, map);
}
System.out.println(lotteryTicketMap);
}
温馨提示:答案为网友推荐,仅供参考