Here you can find the source of saveDoubleArray2File(Double[] doubleArray, String fileName)
public static void saveDoubleArray2File(Double[] doubleArray, String fileName) throws IOException
//package com.java2s; //License from project: Open Source License import java.io.*; public class Main { /**//from w w w. j av a 2 s . c o m * create a new file and save the doubleArray to the fileName */ public static void saveDoubleArray2File(Double[] doubleArray, String fileName) throws IOException { FileWriter fw = null; fw = new FileWriter(fileName); String str = ""; for (int i = 0; i < doubleArray.length; i++) { str = str + doubleArray[i]; str = str + "\n"; } fw.write(str); fw.close(); } /** * save double array ; if there is no file, it creates this fileName, * otherwise it will override this file */ public static void savedoubleArray2File(double[] abnormalNodes, String fileName) throws IOException { FileWriter fw = null; fw = new FileWriter(fileName, false); String str = ""; for (int i = 0; i < abnormalNodes.length; i++) { str = str + abnormalNodes[i]; str = str + "\n"; } fw.write(str); fw.close(); } }