public static void main(String args[]) {
//print a random sequence of N real values in [0,1)
int N = Integer.parseInt(args[0]);
for (int i = 0; i < N; i++) {
System.out.println(Math.random());
}
}
The code is simple. Let's say N == 5. Now, I would like to generate 5 random numbers from [0,1) and store them into a file "data.txt". I do know how to do this in terminal: % java RandomSeq 5 > data.txt. It creates a file "data.txt" and stores the generated random numbers into it. However, how do I do this with Eclipse? I know how to pass in arguments in Eclipse but when I write, It doesn't work. I also tried to use the VW arguments but that did not work, as well.