samedi 5 décembre 2015

How can I write a list of random generated numbers to a file?

This is what I have so far. I am having issues with getting the File Writer to work. Thanks in advanced.

import java.util.Random;

public class Sort {

public static void main(String[] args) {
    Random rand = new Random();

    int q=10000;
    for(int i=0; i < q; i++){

        int foo=rand.nextInt();
    System.out.println(foo);
    }
}

}

I will be using the file to sort later. Please help.




Aucun commentaire:

Enregistrer un commentaire