for(int i = 0; i < 100; i++) { double x = Math.random(); System.out.println(x); } -or- double x; for(int i = 0; i < 100; i++) { x = Math.random(); System.out.println(); }