Writing text into a file in Java
2007-12-22 06:22:08
The easiest way to write text into a file with Java is shown in the next code.
try
{
BufferedWriter out = new BufferedWriter(new FileWriter("outfilename"));
out.write("aString");
out.close();
}
catch (IOException e)
{
}
Beware that this code will overwrite the file.