Here you can find the source of writeFile(final String file, final String text)
Parameter | Description |
---|---|
file | a parameter |
text | a parameter |
static void writeFile(final String file, final String text)
//package com.java2s; // it under the terms of the GNU General Public License as published by import java.io.FileWriter; import java.io.IOException; public class Main { /**/*from w ww. j a va 2 s. c om*/ * Method declaration * * @param file * @param text */ static void writeFile(final String file, final String text) { try { final FileWriter write = new FileWriter(file); write.write(text.toCharArray()); write.close(); } catch (IOException e) { e.printStackTrace(); } } }