/* * Use nested for loops to test the random number generator in Java * Idea is that all of the sums in the inner loop should be pretty much the same * * Created: August 2023 * @author gtowell */ public class Nested { public static void main(String[] args) { for (int i = 0; i < 1000; i++) { int sum = 0; for (int j = 0; j < 10000; j++) { sum += r.nextInt(100); } System.out.println(sum); } } }