Im new to Java and I'm having a little problem writing a series of random number to an output file. I need to used RandomAccessFile and writeDouble. Here is that pice of my code any idea why this is happening. Thanks
private static void numGenerator(int values){
Random generator = new Random();
for (int i = 0; i < values; i++) {
double number = generator.nextInt(200);
System.out.println(number);
String outFile = "output.txt";
RandomAccessFile outputStream = null;
try{
outputStream = new RandomAccessFile(outFile,"rw");
}
catch(FileNotFoundException e){
System.out.println("Error opening the file " + outFile);
System.exit(0);
}
number = outputStream.writeDouble(number); //ERROR
}
}
EDIT: Error: Type mismatch: cannot convert from void to double