Monday, 19 October 2015

Writing into the file using FileWriter in java

import java.io.*;

public class FileRead{
public static void main(String args[])throws IOException{
String str = "This is Performance engineering blog";
FileWriter fw = new FileWriter("test.txt");
for(int i=0;i<str.length();i++){
fw.write(str.charAt(i));
}
fw.close();
}
}



output(file content):-
This is Performance engineering blog

No comments:

Post a Comment