Java examples for File Path IO:FileOutputStream
Create FileOutputStream object from File object
import java.io.File; import java.io.FileNotFoundException; import java.io.FileOutputStream; public class Main { public static void main(String[] args) { File file = new File("C:/Folder/demo.txt"); try {/*w ww . j a v a 2s .c o m*/ FileOutputStream fos = new FileOutputStream(file); } catch (FileNotFoundException ex) { System.out.println("Exception : " + ex); } } }