Java examples for File Path IO:FileOutputStream
Write file using FileOutputStream
import java.io.*; public class Main { public static void main(String[] args) { //from w w w . ja v a2 s . co m String strFilePath = "C://Folder//demo.txt"; try { FileOutputStream fos = new FileOutputStream(strFilePath); byte b = 01; fos.write(b); fos.close(); }catch(FileNotFoundException ex){ System.out.println("FileNotFoundException : " + ex); } catch(IOException ioe) { System.out.println("IOException : " + ioe); } } }