从字符串文件路径创建FileOutputStream对象
/* 来自 N o w J a v a . c o m - 时代Java*/ import java.io.*; public class Main { public static void main(String[] args) { String strFilePath = "C://Folder//demo.txt"; try { FileOutputStream fos = new FileOutputStream(strFilePath); } catch(FileNotFoundException ex) { System.out.println("Exception : " + ex); } } }