java怎么写入文件
收起
云计算小粉
2018-05-10 20:08:01
2926
0
1
条回答
写回答
取消
提交回答
-
FileOutputStream fos = null;
try {
fos = new FileOutputStream("/home/admin/aa.txt");
fos.write('a');
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} finally {
try {
fos.close();
} catch (IOException e) {
e.printStackTrace();
}
}
2019-07-17 22:16:36