FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

GitHub Viewer

import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; public class WriteFile { public static void main(String[] args) throws IOException { FileOutputStream fout = null; try { fout = new FileOutputStream("file.txt"); String s1 = "Welcome Naoe !"; for (int i = 0; i < s1.length(); i++) { fout.write(s1.charAt(i)); } System.out.println("File Written Completed..."); } catch (FileNotFoundException e) { e.printStackTrace(); } finally { if (fout != null) fout.close(); } } }

Back | FazBrowse Home | New Git URL