📄 applicationwritefiletest.java
字号:
import java.io.*;
public class ApplicationWriteFileTest
{
public static void main(String arg[])
{
File f = new File("test2.txt");
DataOutputStream dos;
try
{
//向本地写一个文件
dos = new DataOutputStream(new BufferedOutputStream(new FileOutputStream(f)));
dos.writeChars("this is a test !!!!! ");
dos.flush();
//关闭流
dos.close();
}
catch (SecurityException e)
{
//输出例外栈
e.printStackTrace();
}
catch (IOException ioe)
{
ioe.printStackTrace();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -