Create FileOutputStream object from String file path - Java File Path IO

Java examples for File Path IO:FileOutputStream

Description

Create FileOutputStream object from String file path

Demo Code

 
import java.io.*;
 
public class Main {
 
  public static void main(String[] args) {
   //from   w  ww  . j av  a 2  s.  c om
    String strFilePath = "C://Folder//demo.txt";
   
     try
     {
       FileOutputStream fos = new FileOutputStream(strFilePath);
     }
     catch(FileNotFoundException ex)
     {
       System.out.println("Exception : " + ex);
     }
  }
}

Related Tutorials