public static void main(String args[])
{
Random rnd = new Random();
for(int i = 0; i < rnd.nextInt(100); i++)
{
Random rnd2 = new Random();
System.out.println(rnd2.nextFloat());
}
}
猜猜这段代码输出的序列.
A. 若干个随机数
B. 只有两个随机数
C. 只有一个随机数
{
Random rnd = new Random();
for(int i = 0; i < rnd.nextInt(100); i++)
{
Random rnd2 = new Random();
System.out.println(rnd2.nextFloat());
}
}
猜猜这段代码输出的序列.
A. 若干个随机数
B. 只有两个随机数
C. 只有一个随机数
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货