初学者,捣鼓出的一个作业,('')。
public void testSrot22() {
List<String> stringList = new ArrayList<String>();
for (int i = 0; i < 10; i++) {
Random k = new Random();
Integer k1 = k.nextInt(9) + 1;
String num1 = "";
for (int j = 0; j < k1; j++) {
Random random = new Random();
Integer num = random.nextInt(10);
num1 += num;
}
stringList.add(num1);
}
for (String string : stringList)
System.out.println(string);
}