Java实现简单的数字雨
package com.example.day03;
/*
数字雨
*/
import java.util.Random;
public class RandomNum {
public static void main(String[] args) {
while (true) {
for (int i = 0; i < 40; i++) {
int nextInt = new Random().nextInt(10);
System.out.print(nextInt + " ");
}
try {
Thread.sleep(120);
} catch (InterruptedException e) {
e.printStackTrace();
}
System.out.print("\n");
}
}
}
本文来自博客园,作者:zhooke,转载请注明原文链接:https://www.cnblogs.com/zhooke/p/15399378.html

浙公网安备 33010602011771号