⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 applicationwritefiletest.java

📁 java应用开发详解
💻 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 + -