1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
/* Create FileOutputStream object from File object This example shows how to skip createFileOutputStream object from File object. */ import java.io.*; public class CreateFileOutputStreamObjectFromFile { public static void main(String[] args) { File file = new File("C://FileIO//demo.txt"); /* * To create FileOutputStream object from File object use, * FileOutputStream(File file) constructor. */ try { FileOutputStream fos = new FileOutputStream(file); } catch(FileNotFoundException ex) { System.out.println("Exception : " + ex); } } } |
Faaark. This is so good.