as per my view to read from file program is much easiler . here you have added unnecessary coding ..
it might be easy
import java.io.*;
class FileWrite
{
public static void main(String args[])
{
try{
// Create file
FileWriter fstream = new FileWriter("out.txt");
BufferedWriter out = new BufferedWriter(fstream);
out.write("Hello Java");
//Close the output stream
out.close();
}catch (Exception e){//Catch exception if any
System.err.println("Error: " + e.getMessage());
}
}
}
QuestionEsaux November 22, 2011 at 2:08 PM
How do i write to a file at the server-side data i have received from the client side using sockets in java programming language?
all programs java,veeranagoud December 28, 2011 at 10:36 AM
java programs good...............
bestexampleanilkumar February 11, 2012 at 12:53 PM
very easy example this bufferwriter
!exist is true if the file exists?dan March 29, 2012 at 10:06 AM
poor variable name choice.
quick questionpetaro August 24, 2012 at 12:00 PM
where does this save the file to?
easy way HONEY November 19, 2012 at 10:45 AM
as per my view to read from file program is much easiler . here you have added unnecessary coding .. it might be easy import java.io.*; class FileWrite { public static void main(String args[]) { try{ // Create file FileWriter fstream = new FileWriter("out.txt"); BufferedWriter out = new BufferedWriter(fstream); out.write("Hello Java"); //Close the output stream out.close(); }catch (Exception e){//Catch exception if any System.err.println("Error: " + e.getMessage()); } } }
Post your Comment