2017年3月22日
摘要: 产生15以内的随机数 第一种方式: Random random=new Random(); int n=random.nextInt(15); System.out.println(n) 第二种方式: int m=(int)(Math.random()*15); System.out.println 阅读全文
posted @ 2017-03-22 08:35 ALT_LB 阅读(178) 评论(0) 推荐(0)
摘要: public class test { public static void main(String[] args) { List<Integer> list = new ArrayList<Integer>(); Random random=new Random(); for (int i = 0 阅读全文
posted @ 2017-03-22 08:27 ALT_LB 阅读(1932) 评论(0) 推荐(0)
摘要: 代码结果: 阅读全文
posted @ 2017-03-22 08:14 ALT_LB 阅读(194) 评论(0) 推荐(0)