Creating a File Using File Writer

class CreateFile
public static void Main(String[] args) throws IOException{
String text="This is The File Content on Java" + "\n i am writing This in the
// Attach a file to FileWriter
FileWriter fw=new FileWriter("TestFile");
// read the character wise from string and write into file
for(int i=0;i fw.write(text.charAt(i));
//close the file

No comments:

Post a Comment