Here you can find the source of savePValue2File(double[] pValue, String fileName)
public static void savePValue2File(double[] pValue, String fileName) throws IOException
//package com.java2s; //License from project: Open Source License import java.io.*; public class Main { public static void savePValue2File(double[] pValue, String fileName) throws IOException { FileWriter fw = null;//from w ww. j a va2 s. co m fw = new FileWriter(fileName); String str = ""; if (pValue != null) { for (int i = 0; i < pValue.length; i++) { str = str + pValue[i]; str = str + "\n"; } } else { str = "null"; } fw.write(str); fw.close(); } public static void savePValue2File(double[] pValue, String fileName, boolean flag) throws IOException { FileWriter fw = null; fw = new FileWriter(fileName); String str = ""; if (pValue != null) { for (int i = 0; i < pValue.length; i++) { str = str + i + "\t" + pValue[i]; str = str + "\n"; } } else { str = "null"; } fw.write(str); fw.close(); } }