日期:2014-05-20 浏览次数:20720 次
public static void main(String[] args) { OutputStream os=null; try { os=new FileOutputStream("d:/123.txt"); os.write("1234567学习java IO".getBytes()); os.close(); } catch (FileNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } }
------解决方案--------------------
public static void main(String[] args) { OutputStream os=null; try { os=new FileOutputStream("d:/123.txt"); os.write("1234567学习java IO".getBytes()); os.close(); } catch (FileNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } }