FileDocCategorySizeDatePackage
Random4.javaAPI DocExample625Sun Apr 15 16:20:00 BST 2001None

Random4

public class Random4 extends Object
Print "n" calls to nextDouble() and nextGaussian() in raw form using java.util.Random.next*(); results can be plotted.

Fields Summary
Constructors Summary
Methods Summary
public static voidmain(java.lang.String[] argv)

		// java.util.Random methods are non-static, do need to construct Math
		Random r = new Random();
		PrintWriter file1 = new PrintWriter(new FileWriter("file1"));
		PrintWriter file2 = new PrintWriter(new FileWriter("file2"));
		for (int i=0; i<10000; i++) {
			file1.println(r.nextDouble());
			file2.println(r.nextGaussian());
		}
		file1.close();
		file2.close();