Create FileOutputStream object from File object
- /*
- 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);
- }
- }
- }



