I am trying to store an arraylist of floating points to a file.
I tried using a DataOutputStream to write to the file and it works just fine except that the data is not written in human-readable format.
I know I must use print writer to write the data in text format, however it does not support writing floating points.
PrintWriter writer = new PrintWriter("filename.txt");
writer.write(naiveNearestPoints(points.get(i))); //Gives an error
writer.println(naiveNearestPoints(points.get(i)));//**updated** correct way to do it
Is there any other way I could write floating points to a file in a readable format?